Automated injection
This type of injection allows for the automated and intelligent integration of ad slots according to page templates and some publisher's selectors.
The available parameters provide flexibility for injection.
.setInjectedSelector
: Defines the page element for injection..setInjectedPosition
: Defines the injection position in relation to the element.setInjectedSelector
. Four values available betweenbeforebegin
,afterbegin
,beforeend
,afterend.
.setInjectedMaxRepetition
: Enables limiting the injection occurrences on the page..setInjectedStyle
: Applies a CSS style to the injected ad slot..setInjectedLabel
: Names an ad placement. This name will be incremented at each injection, allowing detailed and proper monitoring. For example: "incontent1" then "incontent2" then "incontent3"..activateInjectedIncrementalAdUnitId
: Enables the activation of the auto-creation of incremental GAM ad units. This is optional and can be useful depending on your inventory structure to better monitor each ad unit's performance..setInjectedIncrementalTargeting
: Enables attributing a specific value to each injected ad unit. It must replace.setTargeting
in case of an identical key in order to avoid duplicate entries.
Here is a code example without the function .activateInjectedIncrementalAdUnitId
:
Here is a code example with the function .activateInjectedIncrementalAdUnitId
:
Last updated