JavaScript Events
The script's parts talk to each other through a small event bus exported by
core.js. Each listener has a priority; higher priorities run first, and each listener
finishes before the next one starts.
Table B.1. Events
| Event | Detail | Emitted when |
|---|---|---|
slot:init | {slot} | A slot is found. The lazy loader starts watching it (priority 100). |
slot:status | {slot, status} | AdSense sets data-ad-status on the slot's ins
element. Collapse listens for unfilled (priority 10). |
adsense:blocked | {slot} or {slot: null} | AdSense is found to be blocked. slot is null when it applies to every
slot on the page. Fallback runs first (priority 100), then collapse (priority 10), which
skips slots already showing fallback content. |
AdSense is treated as blocked when a hidden test element with ad-like class names is hidden by the browser, when the AdSense script fails to load or loads without running, or when it hasn't finished loading three seconds after it started loading. With lazy loading, that clock starts only when the script is injected, not when the page loads.
On This Page