Skip to content

Instantly share code, notes, and snippets.

@marufsiddiqui
Created May 11, 2022 14:16
Show Gist options
  • Save marufsiddiqui/c4a07b7ec52e78e4d1c64520d87e4d82 to your computer and use it in GitHub Desktop.
Save marufsiddiqui/c4a07b7ec52e78e4d1c64520d87e4d82 to your computer and use it in GitHub Desktop.
gpt.js
targetingEntries.forEach(([key, value]) => {
if (key && value) {
googletag.cmd.push(() => googletag.pubads().setTargeting(key, value))
}
})
googletag.cmd.push(() => {
const slots = googletag.pubads().getSlots()
if (slots?.length) {
googletag.pubads().refresh()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment