Skip to end of banner
Go to start of banner

Passing custom key-values to GAM

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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>

  • No labels