Skip to content

Instantly share code, notes, and snippets.

@Souvent22
Created September 25, 2016 16:48
Show Gist options
  • Save Souvent22/92f219a51dd314a17846c0e78108fb95 to your computer and use it in GitHub Desktop.
Save Souvent22/92f219a51dd314a17846c0e78108fb95 to your computer and use it in GitHub Desktop.
<?php
// Global targeting from Tealium
/**
* Get our Tealimum items and let's pass those through.
*/
if (class_exists('\TI\Tealium\API')) {
$api_do = new \TI\Tealium\API();
$udo = $api_do->get_udo();
foreach ($udo as $tealium_key => $tealium_value) {
$time_dfp_config['setTargeting'][$tealium_key] = $tealium_value;
// Ad ops wants aid and gid seperated ( article and gallery )
if ($tealium_key == 'template_type' ) {
if ($tealium_value == 'article') {
$time_dfp_config['setTargeting']['aid'] = $tealium_value;
} elseif ($tealium_value == 'gallery') {
$time_dfp_config['setTargeting']['gid'] = $tealium_value;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment