Hi
For Google Enhanced Conversion Tracking, we need to include a script with the sender’s email address on the contact form thank you page. Is there any way to forward the data from the form to the thank you page to read it and insert it into the script?
We have received the following script from Google. Can this be used together with the Enfold contact form?
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
‘event’: ‘form_complete’,
‘enhanced_conversion_data’: {
“email”: „ (Email address hidden if logged out) “
}
});
</script>
Thx for your support.
Regard, Mike
Hey mediaformers,
Thank you for the inquiry.
You can save the email or any data in a cookie or in the browsers’ local storage, after the form has been submitted. You can then retrieve that data on page load and apply it to the script.
// https://www.w3schools.com/jsref/prop_win_localstorage.asp
// https://www.w3schools.com/js/js_cookies.asp
Best regards,
Ismael
Hi Ismael
Thank you for your reply and the suggested solution.
Sorry, I didn’t mention that we need a solution also for users who refuse cookies. As I’m sure you know, for Google Enhanced Conversion Tracking this is important. So it needs a server side integration. Is this even possible with the Enfold Contact form? We have found an alternative solution with Contact Form 7:
Thanks for your support.