Setup
1. Add a hidden field
In your form, go to Settings > Data Tracking > Edit Hidden Fields. Create a new hidden field namedshow_exit_menu, set the type to Any Value, and save.
2. Add a custom logic rule
- Go to Logic > Create Rule.
- Name the rule
Exit Pop-up Trigger. - Set the event trigger to Form Step is Loaded and click Create.
- Go to the Advanced Logic tab and paste the following code. It listens for mouse movement events where the mouse nears the top or left edge of the browser window.
View code
View code
3. Update the form
- Go to the Designer tab and select the step where you’d like to add the exit pop-up.
- Add a new container beneath the step container and name it
exit_menu. Make sureexit_menuis one level below the Step. - Click the
exit_menucontainer, go to Properties in the right pane, and add the following to Embed Custom HTML:
View code
View code
- Still on the
exit_menucontainer, go to Show Conditionally and create a rule to showexit_menuwhen the hidden fieldshow_exit_menuis True. - Inside
exit_menu, create a nested container namedwindow_popup. This is the visual content of the pop-up.
4. Replicate to other steps
Repeat the following for each additional step where you want a pop-up:- Copy and paste the
exit_menucontainer into the new step. - Rename it (e.g.
exit_menu2). - Update the Embed Custom HTML to reference the new container name:
View code
View code
- Under Show Conditionally, create a rule to show
exit_menu2whenshow_exit_menuis True.
Testing
- Click Publish to publish all changes.
- Open the Test Form and move your mouse toward the top of the browser window.
- Confirm the pop-up appears as expected.
