It’s important that addwish business is correctly installed on your website before you try to set up abandoned cart notifications.
This means you have
- Supplied us with your product data by giving us the URL to your product feed or adding the addwish product span. Click here for a guide on how to do this.
- Supplied us with conversion data by adding the addwish conversion span. Click here for a guide on how to do this.
Allow addwish business to track cart contents
First you have to allow addwish business to track cart contents. This information is needed to send out personalised abandoned cart email notifications, as a of Triggered emails, featuring the image, title and price of the product the customer has left behind.
How can I do this?
You can do this by adding a span into the HTML of your cart page. A span is a small piece of code that will allow addwish to collect data about the contents of the cart every time a user views the cart page. Spans should always be in the body of your HTML (in between
</body>).This will allow the addwish script to read the contents of the cart every time the cart page is viewed by a user.
This is how the span looks, using product urls as a reference to the products in cart:
<span class="addwish-cart" style="display:none" data-url="http://example.com/cart/id/789" data-total="150.50" data-email="firstname.lastname@example.org"> <span class="addwish-product" data-url="http://example.com/product/456.html"> </span> <span class="addwish-product" data-url="http://example.com/product/2234.html"> </span> </span>
This is how the span looks, using product numbers as a reference to the products in cart:
<span class="addwish-cart" style="display:none" data-url="http://example.com/cart/id/789" data-total="150.50" data-email="email@example.com"> <span class="addwish-product" data-productnumber="p-456-2"> </span> <span class="addwish-product" data-productnumber="p-2234"> </span> </span>
The first and last span tags are called the root span. The other spans on the inside are called the inner spans (or product spans).
data-urlattribute in the first line of the span (root span) is optional. If you have a URL which will lead directly back to the cart you can include it here. This will allow you to link directly back to the abandoned cart in your notifications.
data-totalattribute in the root span is required. This should contain the total value of the visitors cart. Please note: The total cart value amount should be formatted with a . (dot) as decimal separator.
data-emailattribute in the root span is optional. This is used to associate an already known email with the cart, this could be if the user is already logged in - then you can associated the users email address with the current cart.
- Inside the root span are a number of product spans. There should be one of these for every product in the cart. If the cart is empty there are no product spans. Addwish can see that the cart is empty because the root span will still be there.
- In each product span, you can choose to reference products in cart either by url or product number. If referencing the product url, the
data-urlattribute must contain the canonical url for the product. If referencing the product number the
data-productnumbershould be the product number.