• Resolved patrickahmed123

    (@patrickahmed123)


    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 EU

    i 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
    }

Viewing 1 replies (of 1 total)
  • hi patrick, can you help me with the same problem? i do all what the manual on_sent_ok deprectated say but dont work… i pasted the same that you for two forms but
    instead of using if and else if, I used only if

    //formularios trackeo

    add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );

    function mycustom_wp_footer() {
    ?>
    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {

    //00-pruebas hector
    if ( ‘8396’ == event.detail.contactFormId ) {
    ga(‘send’, ‘event’, ‘PruebaConversion’, ‘PruebaTalleres’,’PruebaFormHector’);
    }

    //15-09-16-video aprobar EIR 4 meses
    if ( ‘4397’ == event.detail.contactFormId ) {
    ga(‘send’, ‘event’, ‘Conversion’, ‘CapLeads’,’VideoAproberEIR4meses’);
    }

    }, false );
    </script>
    <?php
    }

    is because this? and in the form, i need quit
    the code of additional adjustments? please help me

Viewing 1 replies (of 1 total)

The topic ‘Contact Form 7 tracking analytics’ is closed to new replies.