Google analytics goal tracking
-
Hi I have 2 contact forms on my site (request quote id 227 & contact us id 229) I cant seem to get google analytics goal tracking to pick up when the contact form is completed using wpcf7mailsent
(i normally just track a thankyou page, but apparently contact form 7 works differently)
I’ve added the following code to the header.php<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘227’ == event.detail.contactFormId ) {
ga( ‘send’, ‘event’, ‘Quote Form’, ‘submit’ );
}
}, false );
</script><script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘229’ == event.detail.contactFormId ) {
ga( ‘send’, ‘event’, ‘Contact Form’, ‘submit’ );
}
}, false );
</script>then set up 1 goal in analytics to pick up
category “Contact Form”
Action “submit”another goal
then set up the goals in analytics to pick up
category “Quote Form”
Action “submit”am i missing something I don’t get any goals tracked
The page I need help with: [log in to see the link]
- The topic ‘Google analytics goal tracking’ is closed to new replies.