I am using the plugin Contact in order to create the Contact Form
I added to the code of the Theme functions (functions.php) in the if field of function form_datalayer()
is_page (3355)
// Form datalayer
function form_datalayer() {
if ( is_page(1737) || is_page(1739) || is_page(115) || is_page(2613) || is_page(2103) || is_page(2819) || is_page(20) || is_page(1946) || is_page(1853) || is_page(67) || is_page(2265) || is_page(1188) || is_page(2236) || is_page(39) || is_page(2307) || is_page(39) || is_page(90) || is_page(2179) || is_page(415) || is_page(1220) || is_page(113) || is_page(3355) ): ?>
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
dataLayer.push({
'event': 'Form_Submission',
'Service': document.querySelectorAll('select[name="contact-lessons"]')[0].value,
'Location': document.querySelectorAll('select[name="contact-locations"]')[0].value
});
}, false );
</script>
which is the id of the page that has the form but does not seem to work.