Using one of our ecommerce integrations?
If so, abandoned cart functionality might be configured and implemented differently - and the information below does not apply.
Check the documentation for the integration you’re using.
A user adds several items to their cart. They then abandon their cart. Sometime later, say, 20 minutes, they receive an email saying You have abandoned your cart. Want to continue?.
In opting to continue, the user clicks a link in that email.
Ideally, that link takes them back to your website, and the items they previously added to their cart are still there, ready for them to purchase.
However, the customer might not pick up that email on the same device that they originally created the cart on. For example, if they created the cart on their home PC, and then left the house, they could then receive the email on their mobile.
The challenge
You need to generate a link to the customer’s cart, and supply it as part of the JSON that you send to us. That link has to be a single URL.
Learn more in Dotdigital Tag API methods.
The challenge is that many sites don’t have a way to link back to a cart that hasn't been fulfilled.
Here are a few scenarios that might fit how your site works.
1: Carts are stored in a database on the server
This is the best possible scenario. Usually, if this is the case, the cart in your own database has an ID. Using this method, it should be possible to construct a URL that takes a user straight back to their cart.
For example: https://www.example.com/cart?id=123
2: Carts are stored in browser cookies or local storage
Often an unfinished cart is not actually stored in a database, but is simply stored in a user's browser, either in cookies, or local storage.
In this case, their cart is often present when they return to your site, providing they are using the same device/browser. For example, if the link read https://www.example.com/cart, they might navigate straight back to their partially completed cart. The problem here is that we can't tell they are using the same device.
A possible solution is to encode the cart onto a URL, and then rebuild that cart when they revisit your site.
This would add product ID 123 (quantity x 2), ID 345 (quantity x1), and so on.
Obviously, it would be up to your site's developer to introduce this mechanism, then they can build such a link as part of the code that generates the JSON.
3: Cart is stored in the database, but tied to a given user ID
In this scenario, the cart might be stored against a user who has logged into your website. This means that we can't simply recover the cart using a cart's ID, but require the user to log in.
So here, simply linking to the login page would be the best option.
To make things even better, it might be possible to navigate directly to the cart page after the user has logged in: https://www.example.com/login?redirect_url=/cart.
If a customer is using a device that they’ve previously logged in on, then the above would probably navigate the user directly to the cart page, without even requesting that they log in.
4: Single item purchases
If none of the above are possible, but the customer is purchasing a single item, then simply linking back to that item may be the most sensible thing to do: https://www.example.com/product-123.
That way, they link straight back to a page which allows them to purchase right away without having to search for their chosen item again.
