What I am trying to do is to track the user's click on a Google Adsense. There are two types of ad's being generated by including the Google Adsense script tag.
I have issues with the second type of the banner.
The link comes within two iframes. It's pretty easy to track the click if the user's mouse is on the outer iframe. But I actually can't access the second iframe to track the click if the user clicks on the link ( tag). So if the user clicks on a whitespace in the banner, my function also counts it as a click. The reason is quite obvious: Google denys it.
I don't want to manipulate Google's code, I just want to track the click.
Analytics does track clicks, impressions, and earnings for your AdSense for content ad units. This includes both text and image ads shown through AdSense for content. Analytics does not track search boxes or any other AdSense products.
Google's advertising services don't use IP addresses to track visitors, but they do use a visitor's current IP address to help select ads.
Yes, you're welcome to view your own pages without generating invalid impressions. Simply viewing your pages yourself will not jeopardize your good standing in the AdSense program - however, please continue to avoid clicking on any ads, and don't reload your pages excessively.
I'm not quite sure whether this is allowed by AdSense since you could abuse the system by tracking clicks on ads (e.g. content locking). Additionally, you will encounter different edge cases – like the one you asked – that's why I generally recommend you the following:
What you probably want to do is connecting Google Analytics with AdSense (it's simple as 1-2 clicks) so you can easily navigate to Publisher → AdSense in the Analytics Dashboard to see impressions, clicks and other AdSense data. You can always create custom reports which can access this data.
If you really want to track clicks, you can checkout this iframe tracker which uses blur events to determine which element/iframe the mouse cursor currently hovers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With