Support » Plugin: MailChimp for WordPress » Track subscription with CF7 integration

  • Hi,

    I am using MailChimp for WP integrated with CF7; it works, but I want to track subscription in Google Analytics.

    I’m using this code to verify the submission, and I would to send event to Analytics

    <script type="text/javascript">
    	document.addEventListener( 'wpcf7mailsent', function( event ) {
    	    if ( '1100' == event.detail.contactFormId ) {
    		    //console.log(event.detail);
    		    for ( var i = 0; i < inputs.length; i++ ) {
    				if ( '_mc4wp_subscribe_contact-form-7' == inputs[i].name ) {
    // SEND EVENT TO GA					
    break;
    				}
    			}
    	    }, false );
    	</script>

    I can’t find in event.detail Object the status of the checkbox about subscription.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Lap

    (@lapzor)

    I’m sorry to tell you this kind of custom code if out of scope for our free support.

    I think you need write your own code to check if the box is checked and than trigger the event.

    Hope that helps.

    Thanks for reply.

    I don’t want a custom code ready to use, but just to know if there is an official workaround.

    The problem is that there is no parameter related to [mc4wp_checkbox] in the wpcf7mailsent event of CF7

    Best regards,
    Maurizio

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.