Learn how to recover lost sales with abandoned cart notifications using OneSignal. This guide walks you through tagging, segmenting, and messaging users who leave items in their cart.
Reminding users about items left in their shopping carts is one of the most effective ways to drive conversions and recover lost revenue. When implemented properly, abandoned cart campaigns deliver proven results as shown in our Case Studies.
This step-by-step guide shows how to implement abandoned cart notifications with example code using OneSignal’s powerful tagging, segmentation, and messaging tools.
Use tags to track when users add items to their cart. These tags can include product name, image, and a timestamp:
cart_update
: Unix timestamp of when the cart was updatedproduct_name
: Human-readable product name for personalizationproduct_image
: Direct URL to product image for visual engagementHere’s a basic example to tag items added to a cart:
If users check out or remove items, be sure to remove the tags to avoid false positives.
Remove tags when purchase is complete:
If the user leaves your site without checking out (abandoning their cart), you now have enough information to target them with a personalized abandoned cart notification.
Once the tagging setup is complete we’ll need to target these users and send them messages after some time has passed. In your OneSignal Dashboard, go to Audience > Segments.
Segments allow for grouping subscriptions based on the data collected: 1 - if they have items in the cart and 2 - how long it has been since those items were left in the cart.
This segment will include users that have items in their cart and have left the site or mobile app over 1 hour ago. The user adds an item to the cart, then leaves the app or site, 1 hour later they will be in this segment.
cart_update
to “exists”1
.24
. (the user will leave the segment after 24 hours).Abandoned cart segment example
This segment will include users that have items in their cart and have left the site or mobile app over 1 hour ago. The user adds an item to the cart, then leaves the app or site, 1 hour later they will be in this segment.
cart_update
to “exists”1
.24
. (the user will leave the segment after 24 hours).Abandoned cart segment example
This segment will include users that added an item to their cart over 1 hour ago.
The cart_update
tag key has a unix timestamp value. We can segment users based on how much time has passed since that tag was added.
cart_update
with “time elapsed greater than” and 1
hour.cart_update
tag filter with “time elapsed less than” and 1
day.Abandoned cart segment example
As users add/remove items from their cart and leave/return to the site, they will automatically move in and out of this segment.
You can always come back into this segment later if you want to change the time frame from 1 hour to a higher timeframe.
Segments can be duplicated to create more and setup different time frames if you want to send different messages after longer timeframes as well.
This is where we can use some creativity! If your site/app has certain phrases, language, or emojis you like, then use it! All that is great for brand recognition, get users to click, and getting them to checkout.
Also, using the product_name
and product_image
tags, we can include this data within the message for Message Personalization.
For example, we can say: “Hey Cool Cat 😸 ! Your new Yellow Cat Water Dish is waiting for you!”. And include the picture of the item in the message.
In the OneSignal Dashboard, go to Messages > Templates and select “New Push Template”.
Templates are a way to create reusable message and monitor how many times they have been sent and clicked.
Hey Cool Cat 😸 !
Your new {{product_name | default: "item"}} is waiting for you!
{{product_name | default: "item"}}
will be replaced by whatever value is set for that tag. If no tag is set than “item” will be used.{{product_image}}
{{product_image}}
will be replaced with the URL of the image to the product. If tag value is not a direct link to the image, then it will not show.https://yoursite.com/username/checkout
we need to tag the user with a user_name
tag so their username can be replaced if we use: https://yoursite.com/{{user_name}}/checkout
Abandoned cart message example
Important: you can use any language in these fields (does not have to be English) and if you want to add more than 1 language, just select “Add Languages” to put your own translation for the message.
Under the preview, click “Send Test Message” to test out how it looks!
When done press “Save” at the bottom.
Now that our reusable template is setup, we can return to the Messages > Templates page to keep an eye on how many times this has been sent and opened.
You can create as many templates as you want and across all the different channels you want to send from.
Navigate to Journeys > New Journey.
Abandoned Cart
or anything you like to recognize what this Journey does.1
Day.Journey settings example
Currently users that enter the segment will then start flowing through the Journey. If they leave the segment, they will leave the Journey and can’t re-enter until 1 day has passed.
Journey steps example
1
Week and Save.Your users will be sent the personalized Abandoned Cart template once per 8 days ( 1 week wait node + 1 day re-entry rule) until they either update their car or check out.
You have successfully finished the minimum Abandoned Cart setup! You can now create more templates, add more Journey steps, messages, and update as needed!
When ready just press Set Live.
Once abandoned cart message are set up, you can track how well it performs by going to Templates and looking at the open and click rates.
If you have a Paid OneSignal Account, you can also use Outcomes to track actual revenue brought in.
When the customer finishes payment, upon selection of the “Submit Payment” button call the following method.
OneSignal.sendOutcome("Purchase", purchasePriceTotal);
- will send OneSignal the total purchase amount and accumulate that revenue for all purchases made by all customers that clicked a push or received a push within a specific timeframe (influenced) and made the purchase.
OneSignal.sendOutcome("Purchased Item Count", purchasedItemCount);
- will send OneSignal the total amount of items purchased associated with the customer that directly clicked the push to make a purchase or made the purchase “influenced” by a push.
You are now an OneSignal expert! You achieved an in-depth implementation of OneSignal’s offering and are ready to do more! Continue adding more best practices outlined in our Use Cases or follow the links below to go into more depth on these individual features.
Need help?
Chat with our Support team or email support@onesignal.com
Please include:
We’re happy to help!
Learn how to recover lost sales with abandoned cart notifications using OneSignal. This guide walks you through tagging, segmenting, and messaging users who leave items in their cart.
Reminding users about items left in their shopping carts is one of the most effective ways to drive conversions and recover lost revenue. When implemented properly, abandoned cart campaigns deliver proven results as shown in our Case Studies.
This step-by-step guide shows how to implement abandoned cart notifications with example code using OneSignal’s powerful tagging, segmentation, and messaging tools.
Use tags to track when users add items to their cart. These tags can include product name, image, and a timestamp:
cart_update
: Unix timestamp of when the cart was updatedproduct_name
: Human-readable product name for personalizationproduct_image
: Direct URL to product image for visual engagementHere’s a basic example to tag items added to a cart:
If users check out or remove items, be sure to remove the tags to avoid false positives.
Remove tags when purchase is complete:
If the user leaves your site without checking out (abandoning their cart), you now have enough information to target them with a personalized abandoned cart notification.
Once the tagging setup is complete we’ll need to target these users and send them messages after some time has passed. In your OneSignal Dashboard, go to Audience > Segments.
Segments allow for grouping subscriptions based on the data collected: 1 - if they have items in the cart and 2 - how long it has been since those items were left in the cart.
This segment will include users that have items in their cart and have left the site or mobile app over 1 hour ago. The user adds an item to the cart, then leaves the app or site, 1 hour later they will be in this segment.
cart_update
to “exists”1
.24
. (the user will leave the segment after 24 hours).Abandoned cart segment example
This segment will include users that have items in their cart and have left the site or mobile app over 1 hour ago. The user adds an item to the cart, then leaves the app or site, 1 hour later they will be in this segment.
cart_update
to “exists”1
.24
. (the user will leave the segment after 24 hours).Abandoned cart segment example
This segment will include users that added an item to their cart over 1 hour ago.
The cart_update
tag key has a unix timestamp value. We can segment users based on how much time has passed since that tag was added.
cart_update
with “time elapsed greater than” and 1
hour.cart_update
tag filter with “time elapsed less than” and 1
day.Abandoned cart segment example
As users add/remove items from their cart and leave/return to the site, they will automatically move in and out of this segment.
You can always come back into this segment later if you want to change the time frame from 1 hour to a higher timeframe.
Segments can be duplicated to create more and setup different time frames if you want to send different messages after longer timeframes as well.
This is where we can use some creativity! If your site/app has certain phrases, language, or emojis you like, then use it! All that is great for brand recognition, get users to click, and getting them to checkout.
Also, using the product_name
and product_image
tags, we can include this data within the message for Message Personalization.
For example, we can say: “Hey Cool Cat 😸 ! Your new Yellow Cat Water Dish is waiting for you!”. And include the picture of the item in the message.
In the OneSignal Dashboard, go to Messages > Templates and select “New Push Template”.
Templates are a way to create reusable message and monitor how many times they have been sent and clicked.
Hey Cool Cat 😸 !
Your new {{product_name | default: "item"}} is waiting for you!
{{product_name | default: "item"}}
will be replaced by whatever value is set for that tag. If no tag is set than “item” will be used.{{product_image}}
{{product_image}}
will be replaced with the URL of the image to the product. If tag value is not a direct link to the image, then it will not show.https://yoursite.com/username/checkout
we need to tag the user with a user_name
tag so their username can be replaced if we use: https://yoursite.com/{{user_name}}/checkout
Abandoned cart message example
Important: you can use any language in these fields (does not have to be English) and if you want to add more than 1 language, just select “Add Languages” to put your own translation for the message.
Under the preview, click “Send Test Message” to test out how it looks!
When done press “Save” at the bottom.
Now that our reusable template is setup, we can return to the Messages > Templates page to keep an eye on how many times this has been sent and opened.
You can create as many templates as you want and across all the different channels you want to send from.
Navigate to Journeys > New Journey.
Abandoned Cart
or anything you like to recognize what this Journey does.1
Day.Journey settings example
Currently users that enter the segment will then start flowing through the Journey. If they leave the segment, they will leave the Journey and can’t re-enter until 1 day has passed.
Journey steps example
1
Week and Save.Your users will be sent the personalized Abandoned Cart template once per 8 days ( 1 week wait node + 1 day re-entry rule) until they either update their car or check out.
You have successfully finished the minimum Abandoned Cart setup! You can now create more templates, add more Journey steps, messages, and update as needed!
When ready just press Set Live.
Once abandoned cart message are set up, you can track how well it performs by going to Templates and looking at the open and click rates.
If you have a Paid OneSignal Account, you can also use Outcomes to track actual revenue brought in.
When the customer finishes payment, upon selection of the “Submit Payment” button call the following method.
OneSignal.sendOutcome("Purchase", purchasePriceTotal);
- will send OneSignal the total purchase amount and accumulate that revenue for all purchases made by all customers that clicked a push or received a push within a specific timeframe (influenced) and made the purchase.
OneSignal.sendOutcome("Purchased Item Count", purchasedItemCount);
- will send OneSignal the total amount of items purchased associated with the customer that directly clicked the push to make a purchase or made the purchase “influenced” by a push.
You are now an OneSignal expert! You achieved an in-depth implementation of OneSignal’s offering and are ready to do more! Continue adding more best practices outlined in our Use Cases or follow the links below to go into more depth on these individual features.
Need help?
Chat with our Support team or email support@onesignal.com
Please include:
We’re happy to help!