Close/Open Popup and Create Cookie After Gravity Forms Submission

Popup Maker Version 1.6+ and Gravity Forms Version 2.1+

The latest versions of Popup Maker and Gravity Forms offer serious quality of life improvements for implementing specific popup behavior on Gravity Forms form submits.

Create a Cookie on Form Submit

Create a cookie just like you normally would, except the use the "Gravity Form Success" Cookie Creation Event, as shown in the below video:

Close a Popup on Form Submit

Access the "Close Popup" Action when you build your form inside the Gravity Forms module, as seen in the below video. If you want your users to see your "Success" message, make sure to set a delay (milliseconds) that is long enough so they can read it.

Open a Popup on Form Submit

Access the "Open Popup" Action when you build your form inside the Gravity Forms module, as seen in the below video:

Previous Versions of Popup Maker and Gravity Forms

If you're using older versions of each plugin, be prepared to use some code - we highly recommend updating to get access the sweet features above!

This solution works for Auto Open/Time Delay, Scroll, and Exit Intent Triggers.

Setup Your Cookie

First,  setup your Cookie your using the Manual JavaScript Cookie Creation Event in the Popup Editor.

After clicking Add, you will be able to customize every aspect of how your Cookie will behave. For detailed explanations on all of the Cookie Settings and features, check out the  Cookie Settings and Features Doc.

Add the Code From the WordPress Admin

  1. Edit your form’s confirmation messages.
  2. Check the box to "Disable Auto-Formatting".
  3. Paste your modified code from below, exactly as it is, and save - make sure to change the Popup ID # to your Popup ID # found in the All Popups Screen. You may also want to edit the time value to suit your needs.