I have a google form submitting answers to a google spreadsheet. I have put this form in an IFRAME on our website.
Now I would like to add a script that detects when the Google form is submitted in this iframe. This should then activate a conversion pixel in google analytics.
I've been searching for this for a while now and cannot seem to find the right answer.
My google form containts 2 pages + 1 submit page So I tried counting if the iframe detects 3 load times. Instead of the alert I was thinking to redirect to a thank you page with the conversion pixel.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
count = 0;
$('iframe').load(function(){
count++;
if(count == 3)
alert("activate pixel");
});</script>
</head>
<body>
<iframe id="iframe" src="[LINK TO GOOGLE FORM]" width=100% height="1500" frameborder="0">
<iframe>
</body>
</html>