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 Social Network to add comments!

Join Ning Creators Social 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

Cindy Dean Mccoy replied to Yana Ning Support's discussion Product Plan Update
"We had a scheduled chat session tonight.  But it is not working for us.  Hope they can get this fix…"
6 hours ago
Brandyn Shepherd replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"Chat still is not working. Just says its connecting. Left it open for hours and never connected."
6 hours ago
Brandyn Shepherd replied to Yana Ning Support's discussion Product Plan Update
"Chat still not working. Can't imagine what else might not be working after reading some of the comm…"
6 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Que es Kyryl Este Escudo Rojo Que la venta al principio ☆ ♡ ♤"
7 hours ago
R. Holley replied to Kyryl_Ning_Support's discussion Our Efforts - Your Feedback
"I've been trying forever to get my site to work on a mobile device just like it does on a desktop.…"
9 hours ago
Janice D Carter replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Brendan,
Have you sent in a ticket?  Your issue seems to be different than ours"
12 hours ago
Brendon R Culliton replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Can someone confirm if there is something seriously wrong going on in the back end? For some reason…"
12 hours ago
R. Holley replied to Bousal's discussion MOBILE
"This didn't work for me. I'm trying to let anyone use a mobile phone to see our site just as they c…"
13 hours ago
Naveen Jain replied to Naveen Jain's discussion Anyone able to use https for their network?
"Keeping this thread alive as https is very important for us. Is there a timeline or should I start…"
13 hours ago
Kos replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Just insane"
13 hours ago
Janice D Carter replied to Kyryl_Ning_Support's discussion Our Efforts - Your Feedback
"My feedback is pretty basic.  You expect e to pay for my service and that is very fair.  In return…"
13 hours ago
Janice D Carter replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"My ticket went in 17 hours ago "
14 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"If the crazy horse talks ... connecting ...
☆♡♤"
14 hours ago
Janice D Carter replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"YES!  First thing I do is send emails and a FB chat to NING.  If they don't know there is a problem…"
14 hours ago
Kos replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"I think many just complain here and don't send emails........which is a huge mistake.  The more ema…"
14 hours ago
Janice D Carter replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"LOL, well I am awfully glad you reported it Kos, can we all just combine our tickets and all get ba…"
14 hours ago
Kos replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"Low and behold, look what I just got:
I'm really sorry to hear about your issues with the chat feat…"
14 hours ago
Manuel Adame Jimenez replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"I'll wait ... ☆♡♤"
14 hours ago
Kos replied to Kyryl_Ning_Support's discussion Network not launched yet issue
"They haven't responded to my 'chat' email issue (yet).  Just told me last night the site was up - w…"
14 hours ago
Mike Collins replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Hi Kyryl,
Just want to make sure you saw this as may have been lost in comments 
Search is bringing…"
14 hours ago
More…