Learn how to send web push notifications automatically to any push subscriber who abandons a funnel.
In the simplest sense, a funnel exists when a subscriber visits multiple pages, for example, page 1, then page 2, then page 3. As a result, an abandoned funnel would occur when a subscriber visits page 1 (and also possibly page 2) but does not advance to page 3 within a certain amount of time.
An abandoned funnel can occur with as few as two pages, where a subscriber visits page 1 but does not visit page 2 in a certain amount of time.
The most common use case for targeting an abandoned funnel is form abandonment.
In this walkthrough, we'll show you how to start tracking an abandoned funnel and send an automatic web push notification for a subscriber who doesn't finish filling out a form. We'll imagine page 1 is the first page of the form, page 2 is the second part of the form, and page 3 is the form completion success page.
Step 1: Determine the event
To start, we need to determine what event we want to record when a funnel has been abandoned. In this example, we are tracking someone who does not complete a form submission.
As a result, we want to track:
- Event Category: Form
- Event Action: Abandoned
- Event Label: PageX
As a result, the Event Category is Form and the Event Action is Abandoned. Whenever someone abandons this funnel, we'll track that event against them. We will also track the Event Label as the Page they abandoned on.
Step 2: Grab your website id
Next, grab the website ID of your Aimtell site. To do so, head to your dashboard and click Tracking Code. Make note of what your website ID is. In this example, we'll say it's 999.
Step 3: Add The Abandoned Funnel Scripts
The abandoned funnel script has two main parts. The first part tells the system to start listening and the second part is the confirmation page. Because this is a multi-step form, the listening script will be added to both pages of the form (page 1 and page 2) and the confirmation script will only be added to the form completion page (page 3).
You'll first need to add the listening script to the page which holds the first page of the form. This signals Aimtell to start listening for the event:
<script>
_at.track("funnel", {
"type" : "start",
"id_site" : "999",
"category" : "Form",
"action" : "Abandoned",
"label" : "Page1"
});
</script>
Next, you need to place this piece of code on page 2, which in this example is the second page of the form:
<script>
_at.track("funnel", {
"type" : "start",
"id_site" : "999",
"category" : "Form",
"action" : "Abandoned",
"label" : "Page2"
});
</script>
The final piece of code needs to go on page 3, which in this example is the form completion page:
<script>
_at.track("funnel", {
"type" : "finish",
"id_site" : "999"
});
</script>
In this example, if a subscriber abandons on page 1 (and never gets to page 2), the first event (label: “Page1”) is tracked. If they finish page 1, get to page 2, but never finish that page, the second event would fire instead of the first (label: “Page2”).
Step 4: Create the triggered campaign
Once the scripts are placed on your website, the custom event will start showing up in your logs once subscribers complete the given action (in this case, starting a form but not completing it).
Head to Logs > Custom Events in your dashboard to see the event logged for any subscriber that does not complete the funnel. You can then use this custom event to create a triggered push campaign. Read our Creating a Triggered Push Campaign documentation for help with this.
Advanced: External Completion Page
In some cases, the completion/finish page may not be the original page that the visitor subscribed to. For instance, they may have subscribed to mysite.com but the completion page occurs at checkout.mysite.com.
In this case, you can adjust the finish tracking code to load the funnel functionality without requiring the full Aimtell script. Specifically, add the following line to your code:
<script src="https://beacon.aimtell.com/funnel.js"></script>
For a full example, see below:
<script src="https://beacon.aimtell.com/funnel.js"></script>
<script>
_at.track("funnel",{
"type":"finish",
"id_site": INSERT_YOUR_WEBSITE_ID_HERE
})
</script>
Advanced: Event Variables
Like any Custom Event within Aimtell, you are also able to track additional Event Variables to add another layer of personalization within Pushes. (See this Docs article for more info) An example of this could be in the Form the user is abandoning, you'd want to track the Name Entered as well as the Form URL.
You can then use this Name in the Push and send them straight back to the Form with the URL you tracked. This is a great way to send dynamic and relevant pushes to users.
Please see this code snippet for the additional line of code you'll need to add.
<script>
_at.track("funnel", {
"type" : "start",
"id_site" : "999",
"category" : "Form",
"action" : "Abandoned",
"label" : "Page1"
"variables: {
"name": "David",
"url": "https://mysite.com/form123"
} //custom variables that can be used to personalize push (optional)
});
</script>