Google adsense (onclick event)
Mia Lopez
I am using Google Adsense and I was curious whether I can track user's IP address when they click on the ad. As I found out - I can't.
I have written a small code, which should record user info into the database when they click on the ad.
The problem is to trigger onlcik even on Google Ad (I can't do it for some reason).
<div> <ins></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
</div>My jQuery
$(window).load(function() { $('.google_add > ins').click(function() { // Ajax request $.ajax({ type: 'POST', url: '/script/of/the/tracker.php' }); });
});This doesn't work and for some reason and click even does not work.
I tied
setTimeout()
I tried using setTimeout() - maybe Google does not load fully and it cancels all events on their code - did not work as well.
onclick=""
I tried using onclick="" on of Google - did not work as well.
I don't really know why this problem happens, so please help and tell me if this is possible to do.
UPDATE
This is the jQuery library that allows to do what I was asking - .
SOLVED!
2 Reset to default