cpamatica
Join Cpamatica to access a world of opportunities with our in-house offers, cutting-edge technologies, and never-ending benefits!

Is this the right way to distinguish junk traffic?

RichAds

AffStar

Active Member
Joined
Apr 26, 2024
Messages
64
So I'm struggling with junk traffic, and I found a piece of javascript code that maybe useful.

The code is below
HTML:
<script>
function pushEvent(eventName) {
              eventName = eventName  || 'PageView';
              var img = document.createElement('img');
              img.src =  '/event?e=' + eventName;
              img.referrerPolicy = 'no-referrer-when-downgrade';
              img.style.display =  'none';
              document.body.appendChild(img);
         }

         function pushAfterTimeout(timeout)  {
              setTimeout(pushEvent, timeout * 1000);
         }
    
         var TIMEOUT_IN_SECONDS  = 1;
         pushAfterTimeout(TIMEOUT_IN_SECONDS);
</script>

The endpoint and parameters depend on your tracker.

Most of the bots seem just download the page, they won't execute any javascript code.
But if there are some advanced bots which using headless chrome, I don't think they will wait for any second after loaded everything on the page.
Therefore, there is a high probability that the timer will not be executed.

Then you can see in your tracker which placements have the lowest event ratio.

After several attempts, the results were disappointing. At least 50% of the traffic was
 
Last edited:
To view the premium content in our affiliate marketing forum (including this awesome thread), you must first register and upgrade your account. Register today and become a part of our amazing community!

More awesome affiliate marketing threads 👇

Top