twiforum
01-02-2012, 06:22 AM
I'm trying to integrate DFP Google publisher asynchronous tags on our installation; which requires the following header code:
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/1013431/TWILike_Forum_160', [160, 600], 'div-gpt-ad-1325472136197-0').addService(googletag.pubads());
googletag.defineSlot('/1013431/TWILike_Forum_300', [300, 250], 'div-gpt-ad-1325472136197-1').addService(googletag.pubads());
googletag.defineSlot('/1013431/TWILike_Forum_728', [728, 90], 'div-gpt-ad-1325472136197-2').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
I've tried adding this code to headerinclude at the end. The first block of javascript shows up in the page source when added, but the second block doesn't show up and I get an "unclosed curly brace expression" error.
I've tried enclosed the entire code block in <vb:literal> tags. I've tried enclosing first one block and then the other. But nothing I can do will get that second block to show up.
Any advice/suggestions would be greatly appreciated...
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/1013431/TWILike_Forum_160', [160, 600], 'div-gpt-ad-1325472136197-0').addService(googletag.pubads());
googletag.defineSlot('/1013431/TWILike_Forum_300', [300, 250], 'div-gpt-ad-1325472136197-1').addService(googletag.pubads());
googletag.defineSlot('/1013431/TWILike_Forum_728', [728, 90], 'div-gpt-ad-1325472136197-2').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
I've tried adding this code to headerinclude at the end. The first block of javascript shows up in the page source when added, but the second block doesn't show up and I get an "unclosed curly brace expression" error.
I've tried enclosed the entire code block in <vb:literal> tags. I've tried enclosing first one block and then the other. But nothing I can do will get that second block to show up.
Any advice/suggestions would be greatly appreciated...