Google Tag tracking on multiple forms
-
I Have implemented tracking in my Google analytics account and want to show a different label for each form. This was working until I added the conditional statement (and obviously I just got one event label for all forms), but not now. Any ideas?
<script> document.addEventListener( 'wpcf7mailsent', function( event ) { if ( '592' == event.detail.contactFormId ) { gtag('event', 'Submit Form', {'event_category': 'Contact', 'event_label': 'Contact Form'}); } else { gtag('event', 'Submit Form', {'event_category': 'Contact', 'event_label': 'Request Callback'}); }, false ); </script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Google Tag tracking on multiple forms’ is closed to new replies.