Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Google adsense (onclick event)

Writer 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

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy