Saturday, April 15, 2017

How to get Google Adsense Leaderboard working in XHTML

Getting Google Adsense working in XHTML took me a while to figure it out.  I share the process with you here...

1) Create an ad-leaderboard.html file, similar to this:

        <title>Gliesians Leaderboard</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
            <script type="text/javascript"><!--
   google_ad_client = "ca-pub-XXXXXXXXXXXXXXXX";
                /* Mobile Ad */
                google_ad_slot = "XXXXXXXXXX";
                google_ad_width = 728;
                google_ad_height = 90;
            <script type="text/javascript"

2) Call the ad-leaderboard.html file from your xhtml file like this:

  <object data="/ad-leaderboard.html" type="text/html" style="width: 790px; height: 135px; padding: 0; ">

That's it!  If you have any issues getting it to work, let me know and I'll try to help.

No comments:

Post a Comment

The source code for is for sale on Ebay.

I've decided to shut down and sell the source code. If anyone is looking to purchase the related source, you can find it...