1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

A/B Testing Ad Size and Placement and Adsense for Responsive Sites

Discussion in 'Placement / Reviews / Examples' started by here, Jan 10, 2017.

  1. #1
    I launched my hobby site in 2008. In 2012 I added Adsense ads on a whim and was surprised to make $20 per day. With a little optimizing that quickly went to $50 per day. I've run Adsense for five years. Total revenue is $130K ($71 per day). Over 95% of my revenue is from North America.

    This year, I'm at $75 per day, which is down from last year, which averaged over $80 per day (nearly a 10% drop).

    I average about 10K uniques per day, 3/4 search, 1/4 return. This is up about 1/4 over recent years.

    My site is not responsive, but half of my traffic is mobile. Only about a quarter of my revenue comes from mobile.

    I've been working on an overhaul of the site to make it responsive, more user-friendly and further improve SER. It will have a completely new graphical layout that is much more attractive and professional.

    All that prelude to ask:

    1. What happens to ads on responsive sites when the user resizes their window?

    I can design a lot of different responsive layouts that work well (visually) with all the Adsense ad sizes, but how do I handle displaying of the ads? The problem I see is that at certain sizes my layout will not display an ad to the visitor, but that ad will still load into its undisplayed slot. I assume that's really bad.

    Do I use Google's responsive ads in my predefined-dimensions ad slots? Do I figure out my own conditional loading of ads? Will Adsense recognize that a parent element has display:none despite having the proper dimensions and not load its ad?

    I know Adsense's responsive ad software handles orientation changes on mobile devices by caching the first displayed ad (and probably the second on return to original orientation), but how does it handle width changes on non-mobile devices? I'm concerned about violating terms by hiding and displaying ads via responsive design.

    2. How do I A/B test different ad sizes and positions? I want to use up to the maximum allowable three ads per page. I'm thinking I have about five different possible positions for each ad and five different ad dimensions. So roughly 75 possible ad layouts to test.

    I'm a programmer, so setting up a page to do this is well within my skill set, though it will still be something of a project. I'm guessing it will be worth the effort in increased ad revenue.

    My question, really is how do I run the experiment and keep track of the performance when Adsense only has experiments for variations within ad sizes (text vs. graphic/video, border color, text color, etc.) and not within sizes and placements?

    3. Is Google's mobile ad program more, less or as profitable as other mobile advertising platforms? I get a lot of contact from mobile advertisers and get the feeling that I'm leaving a lot of money on the table there.

    4. Can I test Google's responsive ad delivery on a private development site without causing problems? I'd love to do this, but don't dare put my live account on my development server for fear of getting banned.

    TL;DR: How do I A/B test ad sizes and placements and responsive ads?
     
    here, Jan 10, 2017 IP
  2. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #2
    This is what I used when I ran AdSense ads on my sites. This is fully responsive and you won't have to hide/show ads or be worried that ads may be stretching beyond mobile screen widths, etc. etc. You can also adjust those numbers to whatever you want:

    
    <div id="google-ads-1"></div>
     <script type="text/javascript"> 
        ad = document.getElementById('google-ads-1');
        if (ad.getBoundingClientRect().width) {
            adWidth = ad.getBoundingClientRect().width;
        } else {
            adWidth = ad.offsetWidth; // for old IE 
        }
        google_ad_client = "ca-pub-xxxxxxxxxxxxxx"; 
        google_ad_slot = "xxxxxxxxxxxxx";
        if ( adWidth >= 1200 )
          google_ad_size = ["728", "90"];  /* all */
        else if ( adWidth >= 1024 )
          google_ad_size = ["728", "90"];  /* mini */
        else if ( adWidth >= 640 )
          google_ad_size = ["728", "90"];  /* mini */
        else if ( adWidth >= 540 )
          google_ad_size = ["300", "250"]; /* mini */
        else if ( adWidth >= 200 )
          google_ad_size = ["300", "250"]; /* cell */
        else if ( adWidth >= 180 )
          google_ad_size = ["300", "250"]; /* cell */
        else
          google_ad_size = ["300", "250"]; /* cell */
        document.write (
         '<ins class="adsbygoogle" style="display:inline-block;width:' 
          + google_ad_size[0] + 'px;height:' 
          + google_ad_size[1] + 'px" data-ad-client="' 
          + google_ad_client + '" data-ad-slot="' 
          + google_ad_slot + '"></ins>'
        );  
        (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    
    Code (markup):
    Change xxxxxxxxxxxx to your own. I never ran into any policy issues with AdSense. Dozens of people are using this and other similar methods. Of course, if you're not comfortable, you may email AdSense support to verify if this is legit.



     
    qwikad.com, Jan 12, 2017 IP
  3. here

    here Greenhorn

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #3
    Thanks very much for sharing your code. I'll tweak it to my layout and give it a try.

    I'm going to see if I can some of these other questions answered by Adsense support, as you've suggested.

    Thanks again! :)
     
    here, Jan 13, 2017 IP