1.0.0 • Published 6 years ago

@quintype/fastads v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

@quintype/fastads

Fastads is a library for fast loading of DFP ads. This library uses MutationObserver to insert ads, and should be compatible with react and jquery.

Usage

  • Add gpt via the default gpt script, or via gtm
<script async="async" src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script data-version="@quintype/fastads@1.0.0">// Contents of dist/fastads.js here</script>
  • Wherever you are placing a dfp tag, use the following syntax
<div data-dfp="3849069/Large_Leaderboard" data-dfp-size="[[970,90],[728,90],[320,100],[320,50]]"></div>
  • Please note, the div inserted cannot have an id (as one is generated by fastads)

Parameters

ParameterValueExampleMandatory?
data-dfpAd Unit Id3849069/Large_Leaderboardyes
data-dfp-sizesSizes for the Ad (must be the same as specified in DFP)[970,90,728,90,320,100,320,50]yes
data-dfp-sizemappingViewport to size mapping. This accept pairs that are accepted by SizeMappingBuilder[[1024,768,970,250],[640,480,'fluid'],[0,0,[1024,768,970,250]]]no