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: 479

Replies to This Discussion

Hi Jen,

I know the process directed me to,it doesnt work in that iframe code.

Forbes.
Forbes,
You are better off to use the attached code, instead of an iframe; since all you're doing is adding an image and link above your footer. I wrote this specific to your needs. Donations are always much appreciated. ;-)

Add the attached text/code to your Custom Code box. Be sure to remove the previous code you are using. This will load much faster. BTW, you had some type of magnify the image code. I had to remove that. You can't add a lot of complicated code using this method.

Also, be sure to change the link to suit your needs.

Best Regards,
Jen
Attachments:
Hi Jen,

I add the code its okay,the start x$ # xg_foot" .before ,appear on the side of the image,i delete that part of the code.Hope it doesn't matter?

Your tips are priceless.I cant donate via Paypal.I will let you know before i donate.

Thanks a lot.

Forbes.
Yes the x$#xg_foot is critical. Not sure how you could get it to work without it. I gave you the exact code you needed. If you removed the previous code you were using, it should have worked.
Best,
Jen
I removed the previous code before i add it, and the x$#xg_foot appear beside the image.
Let me take another look at my code. I must have made a mistake.
Do make sure you added it to your Custom Code box (Analytics).

The code I provided in the text file is working perfectly for me, on two sites. So, I don't know of anything else I can offer on this topic.

Sorry,
Jen
Hi Jen,

You didnt make any mistake.I have sought the error,i omit script type=text/javascript when i copied the code.It was my mistake.Its working perfectly now.

You're genius.

Thanks,

Forbes.
Happy to hear it's working!
Best,
Jen
the iframe works magnificently, with the exception that I can not make it blend after my network title and description like yours. It breaks into another row and then pastes the google code. Any ideas?

RSS

Members

© 2024   Created by JenSocial.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Home
VIP Ning Tips