0

I need to track clicks on content that is dynamically loaded. The content is ads by Google adsense. You include their script in the header of a webpage:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0000000000000"
 crossorigin="anonymous"></script>

and then the ads are dynamically placed on different locations of the website.

Because we are facing the problem of fraudulent clicks, we'd like to track who is clicking on them. Is it possible to achieve this through Javascript?

Is it a good idea to intercept all clicks on the web page and then check if the clicked content is an ad?

Are there certain characteristics of the dynamically loaded ads that make them identifieable?

Marius Anderie
  • 23
  • 1
  • 2
  • 12
  • Do you place the ads inside an element or inside the body of your HTML directly? – Dr. Vortex Jan 13 '23 at 12:30
  • I only place the example script in the of the website. The rest is handled by adsense. – Marius Anderie Jan 13 '23 at 12:32
  • This makes it really difficult to detect whether an ad is being clicked or if somewhere else on the page is being clicked... Maybe consider custom placing the ads and then using an event listener on the containers? – Dr. Vortex Jan 13 '23 at 12:37

0 Answers0