Skip to content

Instantly share code, notes, and snippets.

@bradoyler
Created April 3, 2015 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradoyler/a6ddf942e68af9dfc787 to your computer and use it in GitHub Desktop.
Save bradoyler/a6ddf942e68af9dfc787 to your computer and use it in GitHub Desktop.
iframe click track (pdk)
// quick hack to track iframe clicks (for pdkPlayer)
$('iframe').each(function (i,el) {
var iframe = el;
function addIframeClickEvent() {
//console.log('### found iframe', iframe.id);
$(iframe).contents().find('body').on('click', function (event) {
console.log('### click iframe', new Date().getMinutes()+'m', new Date().getSeconds()+'s');
});
}
setTimeout(addIframeClickEvent, 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment