Skip to content Skip to sidebar Skip to footer

Accuratly Catch Clicks On An Iframe

I have an ad iframe being written onto my page dynamically. The advert inside may have another iframe itself and will 'suck' click events through into it so cannot track them easil

Solution 1:

One way to do this without writing lots of javascript detection click logic would be to have the advert on the page and the clickable link links back to your site. Updates a counter and then redirects them to the target page.

The above is just a different way of thinking about it. Plus it will still work if they don't have javascript enabled.

Solution 2:

I think you can't do that using Javascript because of the same origin policy.

My iframeTracker plugin uses a crafty workaround to detect click on iframe, based on mouse and focus events, that simply doesn't work with multiple nested iframes.

Post a Comment for "Accuratly Catch Clicks On An Iframe"