Current status of the Ning Platform is always available on the Ning Status Blog.

Forum

Hi Ning Creators

I want to use DFP on My site, Its ning web 2.0 . There are two parts of generated code of DFP one is Document header and 2nd is Document body. 

According to their instructions  Document header code should between

<head> Document header code</header>

Like this code

<head>

<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('/409633/rectangle_300x250', [300, 250], 'div-gpt-ad-1395370779-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>

</head>

and Document body in text box on placing ads space.

In my case. I have no access to header. I contacted with ning support and they are saying they can't add this code in header. In ning 3.0 it is a option to paste code in custom code and that code shows in header but i am Using Ning web 2.0  and its not possible . So kindly suggest me how to add above header code in <head></head> tags

Waiting for kind response

Regards

Ali

You need to be a member of Ning Creators Network to add comments!

Join Ning Creators Network

Email me when people reply –

Replies

  • I use DFP with Ning 2.0

    You can place the "Document header code" in the ad above header box of your site with no problems. Even if you place an ad in that box.

    And you don't need the <head> tags.

    You only need to load the "Document header code" part, before loading the "Document body" parts you use, and this way you do it.

    Please, try and tell me.

  • Ali apologize I didn't see your message until now.  Fail on my part.  Did Tomas's suggestion help?  Normally when someone says to place code in the above header, you can do so placing it in Custom Code, and then place the 2nd part in the text box where you wish the ad to display.  Let us know if you got this sorted out.  Apologize again.

  • Ali I located this old post from Jen on how to place ads in a the header on 2.0.  idk if it still works but it's worth a shot (?)

  • I am having this exact same problem. Things were working fine until this morning. I had two advertisers - one each taking a separate unit. Today, a new advertiser came on board (Yay!) and was advertising in each unit. So I now had two ads rotating on my top leaderboard and two ads that I wanted to rotate in slots on the right-hand side of my page. 

    The ads were rotating on top just fine, but the older ad stopped showing up on the right-hand side of the page and was replaced by a blank hole. So I blew everything up and re-generated Google tags and now nothing is working. 

    I have this 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('/38051484/160x300_Right_Bottom', [160, 300], 'div-gpt-ad-1406826829551-0').addService(googletag.pubads());
    googletag.defineSlot('/38051484/160x300_Right_Middle', [160, 300], 'div-gpt-ad-1406826829551-1').addService(googletag.pubads());
    googletag.defineSlot('/38051484/160x300_Right_Top', [160, 300], 'div-gpt-ad-1406826829551-2').addService(googletag.pubads());
    googletag.defineSlot('/38051484/728x90_Top', [728, 90], 'div-gpt-ad-1406826829551-3').addService(googletag.pubads());
    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
    });
    </script>

    in my custom code section of my site. 

    And I put this code in my text boxes

    div id="div-gpt-ad-1406826829551-3" style="width: 728px; height: 90px;"> script type="text/javascript">googletag.cmd.push(function() { googletag.display('div-gpt-ad-1406826829551-3'); }); /script>

    I'm not including the tags for each unit, but this should give you the picture (I also had to omit the < from the code because the text wouldn't display otherwise, so those are on the site, but not included here.

    What am I doing wrong?

    • Update...

      Not sure if this is a solution or what, but I found that if I added the header code (the larger amount of code) into each text box on my site, that the ads started showing up. Is that ok?

      • One more update...Found http://dfpgpt.appspot.com/ which is a much easier way of generating tags. Put the header code in my custom code section and the body tags where I want each of my ad units and now I'm waiting to see if it worked.

This reply was deleted.

Search the Creators Network

Latest Activity

Bizz ( John ) replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"Well I do believe this has been fixed now. Just added a video via an embed from youtube and the ima…"
10 hours ago
Bizz ( John ) replied to Bizz ( John )'s discussion Videos Playing In Activity Feed, check it out on my site ( Updated: 25-04-17 )
"Thanks, will share it once I get a few little options finished like adding it's own comment contain…"
11 hours ago
⚡JFarrow⌁ replied to Bizz ( John )'s discussion Videos Playing In Activity Feed, check it out on my site ( Updated: 25-04-17 )
"Wow that is killer Jon!  How did you do that?"
11 hours ago
Bizz ( John ) replied to Erika Hoff Holmgren's discussion How do I edit my opening posts on the forum? Sticky options?
"To edit a post you first open it then in the top right before the +icon you will see a pencil icon,…"
13 hours ago
Ning via Facebook

#NINGread Blogging is an extremely inspiring activity, especially when you can make a buck with…

Kos replied to Thisisbully's discussion Chat is available on 3.0
"Well thank goodness for updating the servers b/c it worked perfectly all day.  I'm sooo happy!  Tha…"
18 hours ago
Kyryl_Ning_Support replied to Thisisbully's discussion Chat is available on 3.0
"Hi there,
Only the server part has been updated by the admins so the performance could have increas…"
23 hours ago
Solveig Parekh Bock is now a member of Ning Creators Network
23 hours ago
Steve C replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Thank you! That's how it was from 2009 to recently, but the system must have reset it and I forgot…"
yesterday
Bizz ( John ) replied to Bizz ( John )'s discussion Video Issues Again For Embed Videos Showing Blank Box
"When is this going to be fixed? Been a while now as it's not just the image not displaying ( by the…"
yesterday
Kos replied to Thisisbully's discussion Chat is available on 3.0
"Kryrl I could be speaking too soon (hope not!) but it appears someone did something b/c Chat is now…"
yesterday
Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi Steve,
We are sorry to hear that you are experiencing such an issue but you can control the orde…"
yesterday
Kyryl_Ning_Support replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"Hi there,
We are sorry for the inconveniences, and yes you are right this issue isn't connected wit…"
yesterday
Oleksii is now a member of Ning Creators Network
yesterday
Steve C replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"I'm having a HUGE problem with blog comments on my Ning 2 site. It used to be that blog comments po…"
Monday
Ning via Facebook

#inspirewithNING #success Explore new horizons with NING and NING Creators Network! Find your…

Bizz ( John ) replied to Bizz ( John )'s discussion Videos Playing In Activity Feed, check it out on my site ( Updated: 25-04-17 )
"Would be interested to hear if anyone has tried this and encountered any problems. Works fine for m…"
Friday
Bizz ( John ) replied to Annabel Gregory's discussion Events on Ning3
"Glad to help for a temporary fix until Ning adds this option. By the way if you want to see it work…"
Friday
Annabel Gregory replied to Annabel Gregory's discussion Events on Ning3
"Thanks, John - I will try your tip. I do hope Ning will make this unnecessary soon, though!"
Friday
Annabel Gregory replied to Annabel Gregory's discussion Events on Ning3
"Thank you, Kyryl, I look forward to hearing from you."
Friday
More…