Loading ...

Adding Google DFP Code to the <head> section

Board index / PHP Melody - Video CMS

For PHP Melody version 2 and newer

Postby westcoastradio on May 27, 2014 7 am


Hi Guys

I'm trying to add some code to the <head> section to enable Google DFP, but when I insert it in header.tpl it results in a blank screen.

I've tried adding it just before </head> and other areas further up but I get the same result.

Any idea what I'm doing wrong?

Here's the 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('/4761035/cltv-ros-mr-right', [300, 250], 'div-gpt-ad-1401171934427-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
westcoastradio
Non-verified
Non-verified
 
Posts: 4
Joined: Jan 09, 2014 12 am
Reputation points: 0

Postby Trace on May 27, 2014 8 am


put it between {literal} and {/literal}
User avatar
Trace
Verified Customer
Verified Customer
 
Posts: 2543
Joined: Aug 16, 2010 3 pm
Location: The Netherlands
Reputation points: 1329

Postby westcoastradio on May 27, 2014 8 am


Worked!

Thanks Trace...
westcoastradio
Non-verified
Non-verified
 
Posts: 4
Joined: Jan 09, 2014 12 am
Reputation points: 0

Postby yahyaelsherif on Jun 29, 2015 8 pm


I've looked everywhere for the {literal} and {/literal} and couldn't find them.

If possible can someone tell me where to find them?

I'm having the same issue.

Thanks
yahyaelsherif
Non-verified
Non-verified
 
Posts: 3
Joined: Jun 29, 2015 8 pm
Reputation points: 0

Postby Trace on Jun 29, 2015 9 pm


They arent there, you have to write them around your code to make sure it works.
User avatar
Trace
Verified Customer
Verified Customer
 
Posts: 2543
Joined: Aug 16, 2010 3 pm
Location: The Netherlands
Reputation points: 1329

Postby yahyaelsherif on Jun 29, 2015 10 pm


Trace wrote:They arent there, you have to write them around your code to make sure it works.


Thank you Trace but it still doesn't work.

http://www.sevendynamicserver.com/video ... =ec8b9c671

http://www.sevendynamicserver.com/videos/

=(
yahyaelsherif
Non-verified
Non-verified
 
Posts: 3
Joined: Jun 29, 2015 8 pm
Reputation points: 0

Postby yahyaelsherif on Jun 29, 2015 10 pm


{literal}
<script type='text/javascript'>
(function() {
var useSSL = 'https:' == document.location.protocol;
var src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
})();
</script>

<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/62250220/1', [728, 90], 'div-gpt-ad-1435616654270-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().enableSyncRendering();
googletag.enableServices();
});
</script>
{/literal}
yahyaelsherif
Non-verified
Non-verified
 
Posts: 3
Joined: Jun 29, 2015 8 pm
Reputation points: 0


Who is online

Users browsing this forum: No registered users and 20 guests

cron