Several people have voiced concerns about using iframes to display Google Adsense, understandably. This is all news to me. So here is my disclaimer: Use At Your Own Risk!

I think it's the manner in which some people use iframes to display adsense, but not certain. My guess is as good as yours. The way I read it, if you're intentionally doing something underhanded like stuffing keywords, or for example adding words to do something like bring up sexy ads -- which unfortunately typically get more clicks. Since we have no option with Ning until July or after, I don't know any other way to do this, that I can explain here.

I definitely will not take responsibility for anyone getting banned on this. I really cannot. If you have an Adsense account, you need to do your own research.



Network Creators often ask: "How do I put my Google Ads in the header?"

How To Add Google Ads or Other Content to Your Header:
Summary - Prepare your content and add to an external HTML. Call into your Network Header via the Analytics Box, using an iframe and JavaScript.

  1. Create your HTML.
  2. For example, if you are adding Google Ads, copy/paste the code into a new HTML file. I usually wrap a DIV around my code, and I add a BODY tag with a white background. Here is the example of my Google Ad code (728 by 15) text links. This example is the entire HTML file.
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ning Directory - Directory of Ning Networks</title>
</head>

<body bgcolor=white><div align=center>
<script type="text/javascript"><!--
google_ad_client = "pub-3491017725492xxx";
/* 728x15, created 7/30/08 */
google_ad_slot = "9036396336";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</body>

</html>


  1. How to center content in your HTML - Within your external HTML, add a DIV with align=center, around your header content. See example HTML file above.
  2. Background color - the best way to set iframe background color: add the body tag to your external HTML, like in example above. This is an important step.
  3. After you have completed your HTML file, upload to your file server. If you don't have a file server, upload to your Ning Network via a Blog (be sure to click on document upload icon).
  4. When you upload to your blog, copy the HTML path. You must know the HTML path/URL.
  5. Now it's time to prepare your code for the Analytics box.
  6. Focusing on the example code below, replace the src="your.html" with your HTML file path.
  7. Adjust the iframe width and height to fit your HTML content area. For example, my Google Ad space is 728 by 15. For my Analytics Box code I will use width=735 and height=20. I want to allow for a few extra pixels, for proper spacing.
  8. After you make your edits, add the example code below, to your Analytics box - Manage/Analytics, and SAVE.
  9. For this example, we are adding the iframe after the Menu Navigation Bar. If you want to add above the menu, just change "after" to "before".
<script type="text/javascript">
x$("#xg_navigation").after("<div id='custom_ads'></div>");
var ad_html = '<iframe frameborder="0" scrolling="no" allowtransparency="true" marginheight="0" marginwidth="0" src="your.html" width="735px" height="20px"></iframe>';
x$("#custom_ads").html(ad_html);
</script>


Views: 477

Replies to This Discussion

How do I center it. I did all the steps, but it won't center. It only center on the HTML
I can't quite figure out what you've added. It's almost like you've added the iframe that calls your html with the ads, twice. When I look at the code via Firebug I see 2 iframes that each contain the google ads. If it hits me what's happened, I'll write again. It could just have something to do with Firebug.

And you could try centering with the code for the Analytics box. I do urge you to check the code though, and make sure you haven't added duplicate code somewhere.

<div align=center id='custom_ads'></div>

Best Regards,
Jen
Thanks now it work. On your code for Analytics box there wasn't a "center"
Jen, I was wondering how do you put ads on each forum,video and on the comment box. Like here you have ads on the forum and below the comment box
The Ads under the forum, video, and comment boxes is fairly extensive custom code. It's not something I could explain in so many words. Sorry about that. Plus, it's one of those that I'm not willing to take on the risks of answering questions, and preventing potential issues across networks.

Basically I write injection points within an external js file. And call the js in via the Analytics box. It's confusing, and one of those I offer within my customization projects. But as in any hack, even when I charge to do it, I warn the receiver that hacks can break any time Ning updates their platform. I promise, if it were easier, I would share. :-)

Best Regards,
Jen
Hmm, I'm having trouble also. I'm not inserting ads, rather trying to insert a twitter icon. I replaced the "your.html" with the twitter icon link, but it places it under the menu bar.. not sure if I did something wrong... or what?
I'm not certain without seeing the code. The one thing that comes to mind, if you use the "after", instead of the "before", it will insert your html after the navigation bar. If you notice in #9, it explains this:

For this example, we are adding the iframe after the Menu Navigation Bar. If you want to add above the menu, just change "after" to "before".


Basically, you should be able to insert any html using these instructions.

Hope that helps,
Jen
I understand. It gets confusing for sure. Be sure to follow each step, very carefully. The code you're referring to is javascript, not CSS. ;-) Are you adding to Analytics Box via Manage/Analytics? Please see #8: After you make your edits, add the example code below, to your Analytics box - Manage/Analytics, and SAVE.

Best,
Jen
k, the reason I said what I said was because (1) it was stripping characters, and if you added javascript to advanced CSS box, it would do this. And (2) you said you were new to CSS, and it's easy to confuse the 2. :-)

Keep me posted.
Best to you,
Jen
Yeah, I think you're right Nicole. I bet that will solve EnerjizedLife's issue. I need to add the align=center to iframe in tutorial. In the past it wasn't needed. But, lately I've seen this come up on several of the tutorials using DIVs and iframes.
Thanks for your help!
Jen
src="(here i added html image)" width="735px" height="20px" align="center">';

how do i point(add) link to the image?
Hi Forbes,
See if this tip will help:
http://jensocial.com/group/ningnetworktips/forum/topics/how-to-add-...
Best,
Jen

RSS

Members

© 2024   Created by JenSocial.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Home
VIP Ning Tips