Detect Google Clicks

I have a gaming community forum where I have installed some Google ads, but people abuse it (out of their good will) and constantly click on them ... now I don’t want to create any illegal clicks on the site, but some people just don't listen.

Is there any way to detect that someone clicked on Google ads ... so I can turn them off for use by who clicked them for a day or so.

Thanks for the help.

+7
source share
5 answers

Google ads are iframes, and Javascript does not have access to the content or add events to it if it is in a different domain and then in the parent site (see iframes law here ).

However, you can put an even div ( visibility: hidden , not display: none ) on top of the iframe and, in a sense, intercept clicks on it. The only problem is that you either intercept the click or not. Therefore, when the user clicks for the first time, you can run your logic, enable or not, and if you want to enable it, display: none your div and prompt the user to click again.

This is almost the only way to do this.

+2
source

If I remember correctly, this is against the rules of Google Ads for tracking clicks on ads, as this leads to incentives for clicking on ads. (for example, turning them off). I understand that you are trying to fix the problem with illegal clicks, but you are actually digging your own grave.

But to answer your question solely with interest in web dev, you can detect the XY mouse position (+ page scroll offset) in window.onbeforeunload and quickly execute a ping server. This is usually done by creating new Image(); with the source being a php file.

This is true for all browsers, regardless of iframe usage.

Good luck

+4
source

Here you have official answers from Google about this:

http://adwords.blogspot.com.ar/2006/03/about-invalid-clicks.html

It is not so difficult to detect duplicate IP addresses, and they can also use cookies to track users. If you do not use a lot of proxies (fake computers) to intentionally deal with fraud, you should not have any problems with this.

Live, which work in Adsense, they have several data sources to detect them. If you have Google Analytics installed, you also give them enough information to undo the tricks.

+1
source

You can use the iframetracker plugin.

 <script src="jquery.min.js"></script> <script src="jquery.iframetracker.js"></script> $('iframe').iframeTracker({ blurCallback: function(){ // Do something when clicked on ad } }); 

for more information and a demo here .

+1
source

You can use the jQuery .click() event with a combination of some storage (cookie or database). Then you simply find the element containing the ads, attach the click event to it and execute your business logic (check if the user has already clicked this before) inside. You can also manipulate how the click ad moves (if it is registered or not), of course.

0
source

All Articles