Sunday, August 4, 2013

Adding Asynchronous AdSense Ads

Javascripts affects the webpage and its loading time this why because adding the javascrip in you HTML tag synchronously.The browser first  gets the  script of the webpage from the server and executes it first and then it execute the other HTML Tag that come after the script.

Steve Souders,He is the Web Performer engineer at Google.He says that Javascript loaded synchrously,this may even block the website from rendering to wensite users and visitors.This may cause to reduce the website ranking and buisness profits.For this purpose only Google Adsense



The script calculates the width of the available ad space and then serves the largest ad unit that will fit into that space.

  1. <div id="google-ads-1"></div>
  2.  
  3. <script type="text/javascript">
  4.  
  5. /* Calculate the width of available ad space */
  6. adWidth = document.getElementById("google-ads-1").offsetWidth;
  7.  
  8. /* Replace ca-pub-XXX with your AdSense Publisher ID */
  9. google_ad_client = "ca-pub-XXX";
  10.  
  11. /* Replace AAA, BBB, etc. with the respective Ad Slot IDs */
  12. if ( adWidth >= 728 )
  13. google_ad_slot = ["AAA", "728", "90"]; /* Leaderboard 728x90 */
  14. else if ( adWidth >= 468 )
  15. google_ad_slot = ["BBB", "468", "60"]; /* Banner (468 x 60) */
  16. else if ( adWidth >= 336 )
  17. google_ad_slot = ["CCC", "336", "280"]; /* Large Rectangle (336 x 280) */
  18. else if ( adWidth >= 300 )
  19. google_ad_slot = ["DDD", "300", "250"]; /* Medium Rectangle (300 x 250) */
  20. else if ( adWidth >= 250 )
  21. google_ad_slot = ["EEE", "250", "250"]; /* Square (250 x 250) */
  22. else if ( adWidth >= 200 )
  23. google_ad_slot = ["FFF", "200", "200"]; /* Small Square (200 x 200) */
  24. else if ( adWidth >= 180 )
  25. google_ad_slot = ["GGG", "180", "150"]; /* Small Rectangle (180 x 150) */
  26. else
  27. google_ad_slot = ["HHH", "125", "125"]; /* Button (125 x 125) */
  28.  
  29. document.write (
  30. '<ins class="adsbygoogle" style="display:inline-block;width:' + google_ad_slot[1] +
  31. 'px;height:' + google_ad_slot[2] + 'px" data-ad-client="' + google_ad_client +
  32. '" data-ad-slot="' + google_ad_slot[0] + '"></ins>'
  33. );
  34.  
  35. (adsbygoogle = window.adsbygoogle || []).push({});
  36.  
  37. </script>
  38.  
  39. /* If you have multiple Ad Units, include this line only once */
  40. <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
  41. </script>

Adding Asynchronous AdSense Ad Tags

When you add the Asynchronous Ad Tags the scripts and HTML tags are loaded evenly and the time ellapsation is reduced and blocking the webpage from the Website users and visitors are completely stopped.So the webpage ranking and profits are not reduced but it chances to render high traffic and profits
                 To ad the Asynchronous Ad tags Keep the Following Steps :

Step 1 :
                                                      Click the Synchronous dropdown list.


Step 2 :                                                                                                                               
                                                                                                                        
                           The dropdown list shows another option Asynchromous(BETA)

Step 3 :

                                     Select the Asynchronous (BETA) option.

Step 4 :                                                                                                                                  

After it Selected Click the adcode region with cursor and follow this key combination Ctrl + A.


Step 5 :                                                                                                                                  
Click Ctrl+c or right click the cursor and  hit copy option to copy the code and pase it on your website or App or More.....



0 comments:

Post a Comment

© Digital Technology Blog 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis