How to make Adsense ads are compatible with all devices

Discussion in 'AdSense' started by fighter007, Nov 2, 2014.

  1. #1
    How to make Adsense ads are compatible with all devices



    Today I will speak about how to make Adsense ads are compatible with all devices.
    As I said, this exposure setups Your blog or different sizes and dimensions. For example Alouhh portable or "tablet" form displays the dimensions of 200x200 and forums that you are in a normal computer, you'll see the same website or blog, but the dimensions of 728x60

    And for this I will introduce you to improve code Adsense ads and agreeing with all the appliances and that advertisements for concurrent and asynchronous


    How to make Adsense ads are compatible with devices

    First we have to have an account in Google Adsense then go to your Adsense from here

    And that you do not have an account you can do in your name and account with ease

    Read also how to work Adsense account and activated easily

    After logged into your account must create a new ad unit in my ads tab and choose any size and from the announcement after you save the announcement

    This code, which I will be inappropriate for people who have no experience with the css code, because this depends mainly on the css codes and codes of media

    Well, Here's the best way to make the Adsense ads are compatible with all devices and this Saviedkm php JavaScript works with both declarations and concurrent asynchronous


    The source code for asynchronous Adsense ads


    <div id="google-ads-1"></div>

    <script type="text/javascript">

    /* Calculate the width of available ad space */
    ad = document.getElementById('google-ads-1');

    if (ad.getBoundingClientRect().width) {
    adWidth = ad.getBoundingClientRect().width; // for modern browsers
    } else {
    adWidth = ad.offsetWidth; // for old IE
    }

    /* Replace ca-pub-XXX with your AdSense Publisher ID */
    google_ad_client = "ca-pub-xxx;

    /* Replace 1234567890 with the AdSense Ad Slot ID */
    google_ad_slot = "1234567890";
    /* Do not change anything after this line */
    if ( adWidth >= 728 )
    google_ad_size = ["728", "90"]; /* Leaderboard 728x90 */
    else if ( adWidth >= 468 )
    google_ad_size = ["468", "60"]; /* Banner (468 x 60) */
    else if ( adWidth >= 336 )
    google_ad_size = ["336", "280"]; /* Large Rectangle (336 x 280) */
    else if ( adWidth >= 300 )
    google_ad_size = ["300", "250"]; /* Medium Rectangle (300 x 250) */
    else if ( adWidth >= 250 )
    google_ad_size = ["250", "250"]; /* Square (250 x 250) */
    else if ( adWidth >= 200 )
    google_ad_size = ["200", "200"]; /* Small Square (200 x 200) */
    else if ( adWidth >= 180 )
    google_ad_size = ["180", "150"]; /* Small Rectangle (180 x 150) */
    else
    google_ad_size = ["125", "125"]; /* Button (125 x 125) */

    document.write (
    '<ins 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>


    Will change the existing code in red in your account number in the Adsense account and I mean this is the identification number and the number in the settings of your Google Adsense and consisting of 10 figures such as: 7,971,451,164


    And then put the code after the tag <body> and then placed before the tag <data: post.body /> in your blog template and after converted in the Adsense codes adapter from here

    And any visitor will see after that Adsense ads are compatible with the device which is used
    And that I wanted to put several ads you put code several times with the announcement to change name

    google-ads-2 and google-ads-3 and forth


    Either your announcements Adsense concurrent code is:


    <div id="google-ads-1"></div>

    <script type="text/javascript">

    /* Calculate the width of available ad space */
    ad = document.getElementById('google-ads-1');

    if (ad.getBoundingClientRect().width) {
    adWidth = ad.getBoundingClientRect().width; // for modern browsers
    } else {
    adWidth = ad.offsetWidth; // for old IE
    }

    /* Replace ca-pub-XXX with your AdSense Publisher ID */
    google_ad_client = "ca-pub-XXX";

    /* Replace 1234567890 with the AdSense Ad Slot ID */
    google_ad_slot = "1234567890";
    /* Do not change anything after this line */
    if ( adWidth >= 728 )
    google_ad_size = ["728", "90"]; /* Leaderboard 728x90 */
    else if ( adWidth >= 468 )
    google_ad_size = ["468", "60"]; /* Banner (468 x 60) */
    else if ( adWidth >= 336 )
    google_ad_size = ["336", "280"]; /* Large Rectangle (336 x 280) */
    else if ( adWidth >= 300 )
    google_ad_size = ["300", "250"]; /* Medium Rectangle (300 x 250) */
    else if ( adWidth >= 250 )


    google_ad_size = ["250", "250"]; /* Square (250 x 250) */
    else if ( adWidth >= 200 )
    google_ad_size = ["200", "200"]; /* Small Square (200 x 200) */
    else if ( adWidth >= 180 )
    google_ad_size = ["180", "150"]; /* Small Rectangle (180 x 150) */
    else
    google_ad_size = ["125", "125"]; /* Button (125 x 125) */
    google_ad_width = google_ad_size[0];
    google_ad_height=google_ad_size[1];

    </script>

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


    if you want to put Adsense ads in several places simultaneous multiple ads and you will have to put this code and follow the same steps that I mentioned for asynchronous Adsense ads
     
    fighter007, Nov 2, 2014 IP
  2. Darth Vader

    Darth Vader Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    3
    #2
    What about just using the "responsive ads"? They automatically change sizes for mobile devices, and change sizes when you switch from portrait to landscape mode.
     
    Darth Vader, Nov 3, 2014 IP
    GuruCreation likes this.
  3. H@rsh Sh@rm@

    H@rsh Sh@rm@ Greenhorn

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #3
    These are the adsense Mobile ads Banners that are available in Different size.
    • Mobile leaderboard (320x50)
    • Large mobile banner (320x100)
    • Small square (200x200)
    • Square (250x250)
    • Medium rectangle (300x250)
    Google adsense automatically adjust the ads size in mobile, Tablets and other types of Devices. So Don't Worry. above are the best sizes to show Mobile ads nd Boost your adsense revenue.
     
    H@rsh Sh@rm@, Nov 6, 2014 IP
    falconlink likes this.
  4. GuruCreation

    GuruCreation Notable Member

    Messages:
    2,780
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    235
    #4
    This is a bunch of nonsense....lol

    Responsive Ads are already in place!
     
    GuruCreation, Nov 8, 2014 IP
  5. falconlink

    falconlink Active Member

    Messages:
    285
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    78
    #5
    No need to follow the codes, I think. It is now very easy to create new responsive ads on your desired sizes.
     
    falconlink, Nov 9, 2014 IP
  6. Darth Vader

    Darth Vader Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    3
    #6
    Also I bet its probably against Adsense policy to put coding in to resize their ads
     
    Darth Vader, Nov 9, 2014 IP
  7. H@rsh Sh@rm@

    H@rsh Sh@rm@ Greenhorn

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #7
    Yes, Darth i heard about it........It against the Policy but people still using this technique.....
     
    H@rsh Sh@rm@, Nov 10, 2014 IP
  8. Daniel.Thomas

    Daniel.Thomas Member

    Messages:
    107
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    25
    #8
    Just use responive ads. Why bother with something else
     
    Daniel.Thomas, Nov 14, 2014 IP
  9. clicktoseo

    clicktoseo Well-Known Member

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    108
    #9
    I think use responsive ad will be easier solution and hassle free.:)
     
    clicktoseo, Nov 15, 2014 IP