2009/04/22

Add Google Ads


Follow the below mentioned steps to put Google adds on your website using “Customer Footer”


 





  • Sign up for a Google Adsense: http://google.com/adsense


  • Create your ad and copy the code into notepad.


  • Add <![CDATA[  before the comment tags (<!--) and ad ]]> at the end of the comment tags (//-->), like the example below.  This does not violate the terms and conditions because tags will be removed when the page is rendered.



Before adding <![CDATA[ ]]>:


 


<script type="text/javascript"><!--


google_ad_client = "pub-9251456609637555";


/* MSOL Add */


google_ad_slot = "6444282108";


google_ad_width = 120;


google_ad_height = 600;


//-->


</script>


<script type="text/javascript"


src="http://pagead2.googlesyndication.com/pagead/show_ads.js">


</script>




  • What the code should look like:



<script type="text/javascript"><![CDATA[<!--


google_ad_client = "pub-9251456609637555";


/* MSOL Add */


google_ad_slot = "6444282108";


google_ad_width = 120;


google_ad_height = 600;


//-->]]>


</script>


<script type="text/javascript"


src="http://pagead2.googlesyndication.com/pagead/show_ads.js">


</script>




  • Next insert a Custom Footer module into the page, you will need advanced design features turned on before you can do this.

  • Either, remove everything between the <template> tags so that it looks like to the code below, or you can also just replace everything in the Custom Footer module with the code below as well.



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">


<xsl:output method="html" />


<xsl:template match="/">


  


</xsl:template>


</xsl:stylesheet>




  • Paste the modified Google Adsense code between the <template> tags, like the example below.



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">


<xsl:output method="html" />


<xsl:template match="/">


<script type="text/javascript"><![CDATA[<!--


google_ad_client = "pub-9251456609637555";


/* MSOL Add */


google_ad_slot = "6444282108";


google_ad_width = 120;


google_ad_height = 600;


//-->]]>


</script>


<script type="text/javascript"


src="http://pagead2.googlesyndication.com/pagead/show_ads.js">


</script>


</xsl:template>


</xsl:stylesheet>



5 comments:

  1. O.k. I did this EXACTLY. But when I paste it into the custom footer I get this message from IE. "The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well formed XML document." WTF? help please.

    ReplyDelete
  2. I use Adsense in my Office Live Small Business website...I used the insert html module.When I press OK a message appears:«To make script tags using the "src" attribute work correctly when using the HTML module, defer="defer" has been added after the URL."»The only problem is that the Adsense only load in Google Chrome.Firefox keeps loading the page 'ad eternum' but never shows the Adsense.Internet Explorer only shows the warning error at the status bar, and never shows the Adsense.Any help on solving this problem?UPDATE 1:Google Chrome 2.0.172.30Firefox 3.0.10Internet Explorer 8.0.6001.18702Opera 9.64 works fine like ChromeSafari 4.0 (530.17) works fine like ChromeUPDATE 2:I have solved the question of the missing Ads whit this solution:http://sumit2306.spaces.live.com/blog/cns!73C5BB3BE3165731!335.entryNow:Google Chrome remains the same.Firefox loads the Ad but keeps on loading (as if something is missing) and in the status bar appears one of the following messages at random: - Read googleads.g.doubleclick.net - Tranfering data from helderdias-com.sitereports.officelive.comIE remains the same.Opera remains the same.Safari remains the same.UPDATE 3:The previous solution makes Opera and Safari present a much wider space after the Ad.

    ReplyDelete
  3. STILL SAYING STYLESHEET DOES NOT CONTAIN A DOCUMENT ELEMENT.THE STYLESHEET MAYBE EMITY,OR IT MAY NOT BE A WELL- FORMED XML FILE HERS ME CODE <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" /> <xsl:template match="/"> <script type="text/javascript"><!--<![CDATA[<!--google_ad_client = "pub-5182841035033819";/* 728x90, created 5/10/10 */google_ad_slot = "6056743003";google_ad_width = 728;google_ad_height = 90;//-->]]></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </xsl:template> </xsl:stylesheet> PLEASE HELP

    ReplyDelete
  4. Simply, one of the best article l have come across on this precious subject. I quite agree with your suppositions and will eagerly look forward to your forthcoming updates.

    ReplyDelete
  5. I am undeniably thankful to you for providing us with this invaluable critical info. My spouse and I are unquestionably grateful, entirely the computer data we needed.

    ReplyDelete

Thankx for your input...