Google Analytics Tracking with Redirect
-
Need some urgent help with my code here:
script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘183’ == event.detail.contactFormId ) {
ga( ‘send’, ‘event’, ‘Form’, ‘Submit’, ‘Enquiry Form’ );
location = ‘https://website.com/thank-you/’;
}
else if ( ‘184’ == event.detail.contactFormId ) {
ga( ‘send’, ‘event’, ‘Brochure’, ‘Download’, ‘Brochure Downloaded’ );
location = ‘https://website.com/thank-you/’;
}
}, false );
</script>As you can see with my setup, I implemented tracking on my forms that triggers some event in analytics then redirect to a thank you page. It was working properly on our previous landing pages but now it doesn’t seem to work. Any help will be appreciated
- The topic ‘Google Analytics Tracking with Redirect’ is closed to new replies.