AffStar
Lurker
- Joined
- Apr 26, 2024
- Messages
- 43
So I'm struggling with junk traffic, and I found a piece of javascript code that maybe useful.
The code is below
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
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: