Quiz redirect only works for users logged into wp-admin

Hello, new here and with gravity forms.
I’m developing a custom quiz that redirects the form data/quiz data to a salesforce pardot form handler.
The issue I’m experiencing is when users who are not logged into the wp-admin panel run the quiz, the redirect is blocked by gf duplicate submission handler and user is sents to “gf_protect_submission” redirect.

The funny thing is in the console I see the correct url followed by the duplicate redirect. I’m not sure why its treating it as a double click/duplicate submission.

Hi Kevin. Whenever the form works when logged in to the admin, but not for front end visitors or visitors who are not logged in, the issue is most likely related to caching. Admin visits are not cached, which is why it works there.

I recommend clearing the cache then disabling any caching, then testing the form. Thank you.

1 Like

Curious to hear if Chris’ guess about caching is correct, @kmarusek.

If it is, and you don’t want to exclude the entire page from the cache, our free Cache Buster plugin (specifically for Gravity Forms) may be a winner.

Hey guys, thanks for the quick responses.
I did some testing and the issue was connected to the “Facebook for Wordpress” plugin. I deactivated that plugin and it was resolved. I know very little as to the “why” that plugin was causing the issue.
If I have time today I’ll try and test it further on my local.

Oh, snap!

I bet this is the same issue I fixed back in June between Facebook Tracking Pixel and the Gravity Forms Polls add-on!

Commit message:
Fixed a conflict between the Facebook Tracking Pixel and GF Polls.

:laughing:

Here’s some extrapolated code:

/**
 * The Facebook Pixel appends it's markup to the confirmation and GF Polls messes it up by trying to remove the closing
 * </div> of the confirmation wrapper so it can include the poll results. This change ensures that GF Polls runs first.
 */
add_action( 'init', 'gw_rehook_gf_polls_confirmation', 16 /* GF inits add-ons on 15 */ );
function gw_rehook_gf_polls_confirmation() {
	if ( is_callable( 'gf_polls' ) ) {
		remove_filter( 'gform_confirmation', array( gf_polls(), 'display_confirmation' ), 10, 4 );
		add_filter( 'gform_confirmation', array( gf_polls(), 'display_confirmation' ), 9, 4 );
	}
}

You’d just need to look up the Quiz add-ons function and filter name and update them in the snippet.

Ultimately, we ditched the Facebook Tracking Pixel in favor of PixelYourSite.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.