Hello and happy new year ! 😀
Since three month, I’m tracking the contact form from avia with this solution :
However, I found that the tracking doesn’t match the number of mails we are receiving.
After some investigation, the problem was easy to find :
When you click on the submit button, the tracking is always firing because it’s an on click action.
Even if it miss an information or if you just click on the submit button and all the fields are empty : it fires the ga action.
How can we make the tracking working when the mail are sent ?
Example with Contact Form 7 : To make Contact Form 7 event tracking come true, at first, I tried listening to wpcf7submit event but what I ended up with was that this DOM event was being dispatched even if required form fields contained errors. As a result, I switched to wpcfmailsent event.
Thanks,
Hey Ludovic,
Thank you for using Enfold.
This is possible with the custom event trigger but you need to modify the config-templatebuilder > aviashortcodes > contact > contact.js file and add the dataLayer function with the custom event as the parameter. You can add it inside the “send_ajax_form” function.
// https://support.google.com/tagmanager/answer/7679219?hl=en#
Best regards,
Ismael
Hi Ismael and thanks,
For information, my version of Enfold wasn’t up to date so I had to modify enfold > js > shortcodes.js
Hi,
Thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
Rikard
Yes you can close it ! Thanks