How To Add Google Analytics OnClick To Wordpress Contact Form 7 Submit Button

As above, I need to add the following ...

onclick="goog_report_conversion ('http://example.com/your-link')" href="http://example.com/your-link"

      

to the submit button generated by Contact Form 7 in Wordpress.

How can i do this?

Thank you in advance

+3


source to share


1 answer


Using an event analyzer trigger when the submit button is clicked,

document.addEventListener( 'wpcf7mailsent', function( event ) {
    ga( 'send', 'event', 'Contact Form', 'submit' );
}, false );

      



REF: https://contactform7.com/tracking-form-submissions-with-google-analytics/

+3


source







All Articles