- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
We have Google ad tags on our site, and are trying to capture the value of "channel" to pass to a tag. Any ideas? Thanks.
googletag.defineSlot('/6031/reserveamerica.tan/camping//nosubchannel/content//homepage//nosubfeature2', [300,250],'med_rec_top')
.addService(googletag.pubads())
.setTargeting("position", "med_rec_top")
.setTargeting("channel","camping")
.setTargeting("subchannel","nosubchannel")
.setTargeting("feature","content")
.setTargeting("subfeature1","homepage")
.setTargeting("subfeature2","nosubfeature2");
googletag.defineSlot('/6031/reserveamerica.tan/camping//nosubchannel/content//homepage//nosubfeature2', [300,250],'med_rec_bottom')
.addService(googletag.pubads())
.setTargeting("position", "med_rec_bottom")
.setTargeting("channel","camping")
.setTargeting("subchannel","nosubchannel")
.setTargeting("feature","content")
.setTargeting("subfeature1","homepage")
.setTargeting("subfeature2","nosubfeature2");
googletag.enableServices();
googletag.pubads().enableSyncRendering();
</script>
Thank you for your question. I went to your webpage to dig around and I found the code you have referenced in your question. This code is "hardcoded" on your site and not in a format that is easily reusable. Here at tealium we highly recommend the use of a Data Layer, in fact it is all over our public websiter:
http://tealium.com/?s=data+layer
We also have some information about the the data layer on the community board:
I am sure you could write some JavaScript that could scrape the DOM and get the value you are looking for, however this is going to complicated and error prone.
It would be better to define utag_data before the Google Publisher Tag, then reuse teh channel value in the publisher tag. Or put the publisher tag inside of Tealium and map the value of channel to both Google Publisher Tag and all the other tags you want to use.
Does this help?
Brian
11-11-2015 06:46 AM - last edited on 11-12-2015 02:58 PM by kathleen_jo
@brian_kranson Thanks for the response. I do understand that using a data layer and putting the Google tag in Tealium is the optimal solution. Unfortunately, that's not my call, and that's unlikely to happen.
Copyright All Rights Reserved © 2008-2023