0.0.12 • Published 5 years ago

@dot-event/ad v0.0.12

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

ad

dot-event gpt ads

coke

Install

npm install dot-event @dot-event/ad

Usage

// Create dot-event instance
//
const dot = require("dot-event")()

// Create googletag init promise
//
const initPromise = new Promise(resolve => {
  window.googletag.cmd.push(() => {
    window.googletag.pubads()
    window.googletag.pubads().enableSingleRequest()
    window.googletag.enableServices()
    resolve()
  })
})

// Extend dot with ad listener
//
require("@dot-event/ad")(dot, { initPromise: initPromise })

// Display an ad unit
//
dot.ad({
  unit: {
    divId: "test",
    path: "/0123456/content1/science-and-chill",
    sizes: [300, 250],
  },
})

Options

OptionDescription
unit.divIdgoogletag.defineSlot opt_div
unit.pathgoogletag.defineSlot path
unit.sizesgoogletag.defineSlot size
unit.sizeMapgoogletag.sizeMapping sizeMapping
unit.a9Attach A9 header bidding
unit.destroyDestroy unit at divId

Events

dot.any("adLoaded", console.log)
dot.any("adRendered", console.log)
0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago