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

Suki Winthrop replied to Fabricio Giugni's discussion Ning 2.0 or Ning 3.0 ?
"Seems familiar.
Nothing much happenig in months,
little communication, still soo  outdated and lack…"
8 hours ago
Tom Whelan replied to David Carr's discussion Being a Ning Network could ruin the deal
"I agree George,
When it comes to actual livelihood and business professionalism, I need stability a…"
8 hours ago
Phil replied to Anna Ning Support's discussion Announcing Events for Ning 3.0
"I like to disable RSVPs because members rarely bother to RSVP. It gives a bad impression when you s…"
9 hours ago
Arman and Tom Whelan joined Ning Creators Network
10 hours ago
⚡JFarrow⌁ replied to Fabricio Giugni's discussion Ning 2.0 or Ning 3.0 ?
"Everything is starting to pick back up as best I can tell.  You are correct in thinking that you sh…"
yesterday
⚡JFarrow⌁ replied to David Carr's discussion Being a Ning Network could ruin the deal
"We can work this in several ways. Give me a call back to discuss..."
yesterday
Fabricio Giugni replied to Fabricio Giugni's discussion Ning 2.0 or Ning 3.0 ?
"How can we trust Ning now? Seems to be everything bad. "
yesterday
Beverly is now a member of Ning Creators Network
yesterday
Kyryl_Ning_Support replied to Fabricio Giugni's discussion Can we see and show member statics?
"Hi there,
Unfortunately, the leaderboards are not available on 3.0 platform.
However, we have fille…"
yesterday
Kyryl_Ning_Support replied to Yana Ning Support's discussion CAPTCHA - NO BOTS AND SPAMMY CONTENT
"Hi Dan,
As we can see you have resolved your issue the same day with our CS representative.
Best re…"
yesterday
Fire-Tech replied to Fire-Tech's discussion 3.0 Tip: Insert Image Into Signin Page
"Yeah, I'm still here in the shadows. Been working on other projects until Ning gets their act toget…"
yesterday
⚡JFarrow⌁ replied to Fire-Tech's discussion 3.0 Tip: Insert Image Into Signin Page
"time to reboot, homey!"
Tuesday
George Swann replied to Fabricio Giugni's discussion Ning 2.0 or Ning 3.0 ?
"All newly created Ning networks are 3.0 by default. You cannot create a new 2.0.
You can however bu…"
Monday
George Swann replied to David Carr's discussion Being a Ning Network could ruin the deal
"My question is this, can my network be moved off the Ning platform to another, one that would not b…"
Monday
Kyryl_Ning_Support replied to Fabricio Giugni's discussion What a special Member can DO?
"Hi Fabricio,
Unfortunately, the options that you have mentioned are not available on our platform.…"
Monday
Deb Della Piana is now a member of Ning Creators Network
Monday
Bizz ( John ) replied to Bizz ( John )'s discussion Re-size Avatars In Messages Table And Messages Detail
"You can adjust the sizes for the ningbar text and icons with just a little css. Just don't go to bi…"
Monday
Bizz ( John ) replied to Bizz ( John )'s discussion Adding Your Friends, Email notifications and SignOut,Sign in To Your Profile Page ( updated so these and the options, social links all inline to the left )
"That's great news your site is backup, any ideas what happened ?"
Sunday
More…