March 14, 2017
Catch Exit-intent with Google Tag Manager
Although most of lead generation solutions (like OptinMonster, Sumo, etc.) offer exit-intent option by default, some of you might want to fire a custom form upon user’s exit.
And the good news is that you can easily achieve that with Google Tag Manager and my ready-made recipe.
How does this solution work?
First, you’ll need to download this Google Tag Manager Recipe and import to your GTM container (make sure you follow the instructions).
It will automatically create a custom auto-event listener which monitors visitors’ behavior on you website. Once their mouse cursor leaves website’s window the listener will create a trigger called exit_intent.
In most cases mouse cursor leaves the window when a visitor intends to close the tab or browser. That’s an opportunity to shoot a special offer (e.g. a discount)!
Ok, So What’s Next?
Now you can use that trigger and assign it to any tag in Google Tag Manager.
Since I don’t have any actual example here, I’ll pretend I am using a made-up lead generation tool called “Optinator”. It has some awesome features but for some reason “Exit-intent” feature is absent.
But it’s not a problem because I can set the rule in Google Tag Manager to fire Optinator’s script only when the visitor tries to leave the website. My following steps are:
- In Triggering section choose “Custom – exit-intent” (that’s a trigger that was included in my Google Tag Manager Recipe).
- Hit Save.
Now my popup will appear only when user’s mouse cursor hovers away from website’s window.
In Google Tag Manager, implementing an exit intent trigger is fairly simple via a custom HTML tag. Download the ready-made solution I have published in this huge library of Google Tag Manager Recipes and import to your GTM container.
The recipe will add a listener which tracks visitors’ intentions to leave the website and creates trigger. Assign that trigger to any tag in Google Tag Manager and you’re good to go!