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

Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Yeah, well please pass along to the programmers in charge of such decisions that this new "feature"…"
6 minutes ago
Ning via Facebook

#createwithNING Each online community is unique and special. What`s YOUR secret of network…

Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi Stanislav,
I do apologise for the misunderstanding. It seems that my colleague has decided that…"
14 hours ago
Kyryl_Ning_Support replied to Kevin Acosta's discussion Photo uploads being auto resized
"Hi there!
The same question has been mentioned in this discussion http://creators.ning.com/forum/to&hellip;"
14 hours ago
Sherry Ritchie and James joined Ning Creators Social Network
15 hours ago
Stanislav replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Kyryl, here is my ticket log with Anastasia, from which I understood I need to create new page and…"
16 hours ago
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Thanks for the response Kyryl, but based on Ning's history of not launching things on time, I can't…"
16 hours ago
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Naveen, please tell me more. Were you able to integrate Stripe with your Ning site in a way that re…"
17 hours ago
Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Well, even the FULL SIZE 38.5" x 36" poster that I attache was scaled down, so now that doesn't eve…"
yesterday
Kyryl_Ning_Support replied to Aubrey Williams's discussion Paid Access 2017
"Hi there,
We plan to initially release the PaidAccess for Ning 3.0 with PayPal and credit card supp…"
yesterday
Kyryl_Ning_Support replied to Naveen Jain's discussion Wiki like functionality in Ning
"Hi there!
Unfortunately, we don't have the module on our platform that would be working in the way…"
yesterday
Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi there!
Thanks for the question.
No, you don't have to create the new network each time the new f…"
yesterday
Matt replied to Aubrey Williams's discussion Paid Access 2017
"Good point, Stripe is awesome. "
yesterday
ASDKFljflkj is now a member of Ning Creators Social Network
yesterday
Alliance replied to Alliance's discussion Profile members on MY Page
"Thanks so much for this help things look sooooo much better now."
yesterday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"You could also try this which I have on my site just now for testing. This will adjust the avatar s…"
Sunday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"As matrix items are shared with other parts of the network if you add that then this would affect t…"
Sunday
Stanislav replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi, I'm waiting you to implement all new features to the Network in Q2 and want to start my network…"
Sunday
Alliance replied to Alliance's discussion Profile members on MY Page
"Thank you 
Right now I have a big space between each item. Following that same logic, the container…"
Sunday
Bizz ( John ) replied to Alliance's discussion Profile members on MY Page
"You can adjust the avatar sizes with this, just change the width to the size required.
.section-mem…"
Saturday
More…