/
Passing custom key-values to GAM
Passing custom key-values to GAM
The publisher is able to pass custom key-values to the ad server by using the system. This information needs to be provided in the data layer. It can be done by using ‘atf-targeting’ parameter. There is no limitation of numbers of key-values pairs that can be passed. However, we always suggest removing unused pairs.
Examples:
pushing single key-value pair
dataLayer.push({'atf-targeting': { 'atf_sdk_custom_key': 'testing'}})
pushing 2 or more key values
dataLayer.push({
'atf-targeting': {
'atf_sdk_custom_key': 'testing',
'atf_sdk_custom_key2': 'test2',
'atf_sdk_custom_key3': 'test3' }
})
pushing more than 1 value for a key
dataLayer.push({
'atf-targeting': {
'atf_sdk_custom_key4': ['test', 'test2']}
})
example of entire data layer script for <head> section with key-value parameter
<script type="text/javascript">´
window.dataLayer = window.dataLayer || [];
dataLayer.push({ 'atf-contentType': 'gallery' });
dataLayer.push({ 'atf-channel': 'testchannel123' });
dataLayer.push({ 'atf-targeting': {'atf_sdk_custom_key': 'testing'}})
</script>
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>"
<atf-ad-slot id="my_site_ad_slot_4" atf-format="content" atf-formatSize="1000x250" atf-targeting-topic="health">
</atf-ad-slot>
, multiple selections available,
Related content
In <head> Section
In <head> Section
More like this
Updating the data layer information
Updating the data layer information
More like this
Guidelines & Limitations
Guidelines & Limitations
Read with this
Key-Values tab
Key-Values tab
More like this
Ad slots formats
Ad slots formats
Read with this
Global key-values
Global key-values
More like this