I’m trying to track clicks in the Spotify Play Button iframe using Google Analytics, without much success so far. I’m attempting to use jQuery to capture the click.
The code
$('iframe .clickable.play-pause-btn').click(function(){
alert('foo');
});
obviously doesn’t work as it’s cross domain. Is there any alternative that can capture these clicks? Or do I just live safe in the knowledge that I’ll never know how many users hit play?
Thanks in advance!
I think that the cross domain policy wont let you track an event on an element inside an iframe that’s running on a different domain.
I dont think we have a solution to send tracking info to the parent window.