CF7 & event tracking integration – modal doesn't close with on_sent_ok
-
First of all, I love your plugin. I have a slight problem that I suspect will be very easy for you to address. I’m currently using Easy Modal to create CF7 Pop-up forms on my site. Everything has been working fine. However, I’m trying to add Google Analytics event tracking to the CF7 modal form. I have it setup so GA records an event after the form is successfully submitted using the on_sent_ok hook. Unfortunately, adding my GA tracking code to the CF7 additional settings area causes the modal to no longer close automatically after the form successfully submits. I suspect the GA on_sent_ok command is interfering with the modal’s ability to execute its own on_sent_ok. Here is the GA code:
"on_sent_ok: "_gaq.push(['_trackEvent', 'Landing Page Modal', 'Submit']);"
To correct this, I believe I can add a second on_sent_ok command right below the GA tracking one in order to manually call the Easy Modal close hook. Unfortunately, I don’t know enough about JS to do this. I believe it would be something like this:
"on_sent_ok: "$eModal.overlayClose();"
But I’ve tried several variations and can’t figure it out. Can you help me call the correct overlayClose function so I can add it to my CF7 and successfully integration Google Analytics, Easy Modal, and CF7? It would be a lifesaver. Thanks a million for your help!
- The topic ‘CF7 & event tracking integration – modal doesn't close with on_sent_ok’ is closed to new replies.