5

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>
Sven
  • 63
  • 2
  • 9
  • Can you post some code that shows what you have tried? – MichaelDotKnox Jan 02 '17 at 11:26
  • 1
    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. – Sven Jan 02 '17 at 11:32
  • thanks man this really helped me to make an action after submitting a google form from an iframe! – Santiago Rebella Sep 22 '17 at 21:25

0 Answers0