Lazy Loading AdSense Ads could Lead to Invalid Traffic

User Author

Achilles.H

July 29, 2021

Lazy Loading AdSense Ads could Lead to Invalid Traffic

Your AdSense account has been suspended? Google also had my Google AdSense account suspended due to the invalid traffic concern and this article Lazy Loading AdSense Ads could Lead to Invalid Traffic is to tell you how I solved it in the end.

What happened?

Google thought I was cheating on ads and had my account suspended twice within a few days and gave no specific reason but said there was invalid traffic. Whereas, there was no significant change in the traffic of the website and some pages with lots of traffic.

google adsense account suspended

Through analysis, auto-clicking was less likely to be considered a cause of invalid traffic. Maybe someone deliberately clicked on it multiple times, but who would attack my website this way? Plus, Google's anti-cheating algorithm was pretty intelligent that this kind of attack shouldn't be that easy.

How did I solve this invalid traffic concern?

About half a month after the second time my AdSense account was suspended because of invalid traffic, I had lost hope of getting my AdSense account back and prepared to remove all the AdSense ads.

However, I suddenly realized that this invalid traffic concern could be caused by lazy loading the AdSense ads. In order not to slow down the page loading speed, I had delayed the AdSense ads to load by 1.5 seconds using the following JScript code.

        <script type="text/javascript">
         window.onload = function(){setTimeout("loadAds()", 1500); 
         } 
         
        function loadAds(){
           loadScript('https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',function(){
               console.log("loaded script.")}); 
        }  
             
        function loadScript(src, callback) {      
        var script = document.createElement('script');          
        var head = document.getElementsByTagName('head')[0];      
        script.type = 'text/javascript';      
        script.charset = 'UTF-8';      
        script.src = src;      
        if (script.addEventListener) {          
            script.addEventListener('load', function() { callback();}, false);      
        } else if (script.attachEvent) {
            script.attachEvent('onreadystatechange', function () {  
                var target = window.event.srcElement;  
                if (target.readyState == 'loaded') { 
                callback();
                }  
            });      
        }      
        head.appendChild(script); 
        }
        </script> 
        

Thus, my AdSense ads loaded 1.5 seconds after the page finished loading, while other people's ads and pages loaded at the same time. Therefore, the time between AdSense ads loading and clicking on my website was shorter than other people's.

Google might think it was abnormal as the AdSense ads were clicked once loaded, which was similar to invalid clicks.

I emailed Google and told it about this situation. Meanwhile, I also reduced the delay of lazy loading to 0.5 seconds, and the Google AdSense ads went back to normal the next day.

I don't know if it was a coincidence, but there were no suspensions or restrictions on Google AdSense ads display for months after that.