Contact Form 7 tracking analytics
-
Im trying to track Contact form 7 Submission, the settings are as follows:
Goal set-up = custom goal-type=event;
Goal description = CF7 Submission
Goal Detail: Category=CF7 Form – Action=Submission – Label=Contact EUi pasted this code into functions.php:
add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
function mycustom_wp_footer() {
?>
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if ( ‘3907’ == event.detail.contactFormId ) {
ga(‘send’, ‘event’, ‘CF7 Form’, ‘Submission’, ‘Trial EU’);
}
else if ( ‘3984’ == event.detail.contactFormId ) {
ga(‘send’, ‘event’, ‘CF7 Form’, ‘Submission’, ‘White paper EU’);
}
else if ( ‘373’ == event.detail.contactFormId ) {
ga(‘send’, ‘event’, ‘CF7 Form’, ‘Submission’, ‘Contact EU’);
}
}, false );
</script>
<?php
}
The topic ‘Contact Form 7 tracking analytics’ is closed to new replies.