Skip to main content
All CollectionsGet Started1st Steps
Tagging Shopping Cart Content
Tagging Shopping Cart Content
Dan Macarie avatar
Written by Dan Macarie
Updated over 2 months ago

For updated information, please see: Cart-Tagging in our documentations

Tagging shopping cart content enables Nosto to recommend products based on the user’s shopping cart and to track and notice abandoned carts.

<!-- Tag your customer's shopping cart contents, replace static example values to equivalent database/ecom engine variables  -->
              <div class="nosto_cart" style="display:none">
                <!-- Check your ecom engine how to loop over items in customer's shopping cart to produce the line_item divs  -->
                <div class="line_item">
                  <span class="product_id">CANOE123</span>
                  <span class="quantity">1</span>
                  <span class="name">ACME Foldable Canoe</span>
                  <span class="unit_price">1269.00</span>
                  <span class="price_currency_code">EUR</span>
                </div>
                <div class="line_item">
                  <span class="product_id">TOOTHBR</span>
                  <span class="quantity">3</span>
                  <span class="name">Large yellow toothbrush</span>
                  <span class="unit_price">19.00</span>
                  <span class="price_currency_code">EUR</span>
                </div>
               
                <!-- Optional restore cart link for abandoned cart emails. Check your ecom platform if it supports this kind of link -->
                <div class="restore_link">https://example.com/cart/restore?cart=4D5C3060-1334-4C63-B6FA-D9D342D88B08</div>
               
              </div>

General Guidelines

Add the following tagging to your shopping cart segment and also to the mini-shopping cart that is visible on each page load typically in the top right corner of the page.  If the mini-shopping cart built using javascript or Ajax, please study API documentation how to push cart content to Nosto. Loop the cart items to produce order rows or line items as in the example.

On the assumption that your e-commerce platform stores a cart recovery link for all shopping carts, map the link to Nosto by mapping the recovery link url inside restore_link -field in the tagging. In case you want to leverage Nosto’s abandoned cart email feature, mapping the link to Nosto allows an immediate and easy recovery of the cart content directly from the email. Please note that the cart recovery link is a platform feature mapped to Nosto. Nosto itself, doesn’t restore cart but refers to the link while platform recovers the cart.

How To Test

Test by adding couple of products to your cart and pay attention using debugger that quantity of line items works accordingly and also double-check that the productID is consistent with the productID tagged on the product page. The ID should be for the main product (mother) hence leave the SKU or product variable identifier out.

Once the content looks good to you, it is time to tag customer information on the log-in area.

Did this answer your question?