You can pass page level custom KV data into Google Ad Manager with the following API:
window.dataLayer = window.dataLayer || []
dataLayer.push({
event: 'gam.targeting',
KEY_NAME: VALUES,
})
For example:
window.dataLayer = window.dataLayer || []
dataLayer.push({
event: 'gam.targeting',
keywords: ['English Premier League'],
pageType: 'article',
})
You can use the following API to disable the advertising on a URL:
window.dataLayer = window.dataLayer || []
dataLayer.push({
event: 'bs.targeting',
articleType: 'noads',
})
if (window.BIDDINGSTACK) {
window.BIDDINGSTACK.api.teardown()
window.BIDDINGSTACK.api.bootstrap()
}
If the website utilises infinite scrolling, there could be new ad slots added to the page dynamically. You have to call the following API after content is rendered on the page, and then the engine will fill ads into the new ad slots.
if (window.BIDDINGSTACK) {
window.BIDDINGSTACK.api.discoverSlots()
}