Set up a custom event to track when a subscriber exhibits exit intent behavior. Use this custom event to retarget the user with an automated web push notification.
Here are the steps to take to set up tracking exit intents at your website:
Step 1: Place the Exit Intent Code Snippet
The first step is to add the following snippet above your main Aimtell Tracking Script:.
<script>
function _aimtellReady() {
document.addEventListener("mouseout", evt => {
if(evt.toElement === null && evt.relatedTarget === null) { //on Exit intent, track the event with current page
//add optional variables for personalization of item they went inactive on (e.g. related items, related pages to send them to)
_at.track("event", {
"category" : "Page",
"action" : "Exit Intent",
"variables": {
"page": window.location.href
}
})
}
});
}
</script>
Note that you can add optional variables for added personalization such as related items or related pages.
Step 2: Check Your Logs
Once you have added the code to your site, we recommend checking your logs to see if the custom event has started to track. Head to Logs > Custom Events to see if it is there. We recommend letting the code run for 24 hours so that you can easily see the events being logged in your dashboard.
Step 3: Create A Triggered Push Campaign
Now it is time to create your triggered push campaign that will send whenever a subscriber activates the trigger which in this case means they exhibited an exit-intent on a page at your website. Head to ‘Triggered Campaigns’ from your dashboard and create a new campaign. For your trigger, the Event Category is ‘Page’ and Event Action is ‘Exit Intent'
Read our Creating a Triggered Push Campaign documentation for a step-by-step guide on how to do this.
Note: Aimtell will by default only track the same exact event once per session. This will prevent the creation of numerous events if a user were to keep scrolling away from a page and then coming back numerous times, therefore ensuring that the user will not be spammed with tons of notifications.