• Resolved bigraffa

    (@bigraffa)


    Hi,
    I have a double event when submitting the form if confirm is “page”.
    In setting, if the form submission confirmation is: page; I have a problem. When I submit the form I have the recording of two GFTrackEvent events. This is a problem for Analytics and TGM events. If I change the confirmation with a message in pages, the problem is not there. The event, when submitting the form, is only one. What am I doing wrong?

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Jon

    (@freshyjon)

    I have this exact issue too. It’s strange though, because the 2 identical “Events” are actually triggering on the form’s page (there is no event triggering on the Thank You page). So I’m not sure how/why it’s occurring. But this definitely seems like a bug that needs to be fixed.

    I have the same issue too. Gravity form or the event tracking plugin fires twice if the confirmation is page. My current workaround is to modify the event tracking plugin and put a flag on it, so it only fires once… But I have to do it all over again if the plugin update to a newer version.

    Plugin Author Ronald Huereca

    (@ronalfy)

    @zahadum can you please share what changes you have made?

    I have to modify the below file.

    wp-content/plugins/gravity-forms-google-analytics-event-tracking/includes/GFGAET_Submission_Feeds.php

    And change the below code from

    if ( typeof( window.parent.dataLayer ) != 'undefined' ) {
    	window.parent.dataLayer.push({'event': 'GFTrackEvent',
    		'GFTrackCategory':'<?php echo esc_js( $event_category ); ?>',
    		'GFTrackAction':'<?php echo esc_js( $event_action ); ?>',
    		'GFTrackLabel':'<?php echo esc_js( $event_label ); ?>',
    		'GFTrackValue': <?php echo absint( $event_value ); ?>,
    		'GFTrackSource': utmSource,
    		'GFTrackMedium': utmMedium,
    		'GFTrackCampaign': utmCampaign,
    		'GFTrackTerm': utmTerm,
    		'GFTrackContent': utmContent,
    		});
    
    }
    </script>

    to

    if ( typeof( window.parent.dataLayer ) != 'undefined' ) {
    	if (typeof(window.parent.check) != 'undefined' ) {//prevent firing twice
    		window.parent.dataLayer.push({'event': 'GFTrackEvent',
    			'GFTrackCategory':'<?php echo esc_js( $event_category ); ?>',
    			'GFTrackAction':'<?php echo esc_js( $event_action ); ?>',
    			'GFTrackLabel':'<?php echo esc_js( $event_label ); ?>',
    			'GFTrackValue': <?php echo absint( $event_value ); ?>,
    			//sensitive data//'GFEntryData':<?php echo wp_json_encode( $entry ); ?>,
    			'GFTrackSource': utmSource,
    			'GFTrackMedium': utmMedium,
    			'GFTrackCampaign': utmCampaign,
    			'GFTrackTerm': utmTerm,
    			'GFTrackContent': utmContent,
    			});
    	}
    }
    window.parent.check="true";//flag
    </script>

    I don’t want to modify the code like that, but It’s an emergency fix for us.
    Cheers,

    • This reply was modified 3 years, 7 months ago by zahadum.
    • This reply was modified 3 years, 7 months ago by zahadum.

    I was about to post this issue as well. Any time frame when/if we can see this in an upcoming release?

    Thanks,
    AJ

    Plugin Author Ronald Huereca

    (@ronalfy)

    Thanks @zahadum

    I’ve added this to 2.4.9.

    Regards,

    Ronald

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Double Event if confirmation send form on page’ is closed to new replies.