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

OXY 3 Parts Needed

This blog post lists the parts needed to build and operate an OXY 3 .... but first an Oxy 3 unboxing video! Lynx OXY3-255 - Oxy 3 H...