Functions for React Single-Pages
Resetting ad units counter
In ATF SDK there is a public method to reset the ad units counter on demand.
atf.resetCounter()
Destroying ad slots removed from DOM
In ATF SDK there is a feature which automatically destroys ad slots in GAM when it is detected that they are removed from the DOM. It can be turned on/off in ATF-Manager.
NOTE! This feature is only implemented when automated ad slot detection is turned on. Usually for React based publishers this feature ist turned off!
Mapping new ad slots on a function call
In ATF SDK there is a possibility to map a new ad slot on a function call.
To register new ad slots manually call atf.registerSlots() with array of slot ids to register:
atf.registerSlots(['adSlotId1', 'adSlotId2', '...'])
To unregister new ad slots manually call atf.unregisterSlots() with array of slot ids to register:
atf.unregisterSlots(['adSlotId1', 'adSlotId2', '...'])
Add atf-targeting as attribute (Slot Targeting)
This attribute is optional and build by request. It is possible to define targetings like attributes in the ad slot via atf-targeting-<key>="<value>"
Example: