Cart

Foreword

AT Internets SDK allows you to tag your applications basket or cart, as well as its contents.

As with a real cart, you can add or remove products from the cart and send this information in your screen hit.

Get off to a good start

Once your tag is initialised, you can add cart information to your screen hit.

In the case of a Swift project, be sure to import the Tracker (or TrackerExtension if your target is an extension) module in your ViewController. In the case of an Objective-C project, be sure to import the headers ATInternet.h, ATTracker.h, ATScreen.h, ATCart.h and ATProduct.h.

Tagging

The tracker makes a cart property available. This property exposes the following methods:

set (or setWithId in Objective-C): Allows you to define a cart ID to then be able to add products

So that cart information is successfully taken into account, the ID must be greater than zero

unset: Allows you to remove products from the cart and to reset the carts ID

The cart property also exposes a products property allowing you to add or remove products to/from the cart.

The products property exposes the following methods:

add(or addWithIdin Objective-C): Adds a product to the cart and returns a Productobject

remove (or removeWithId in Objective-C): Deletes a product from the cart

removeAll:Removes all products contained in the cart

To send cart information without sending order information, you must define the property isBasketScreen of your Screen object as true. If not, cart information will not be added to your screen hit.

Tagging examples

Tagging a screen summarising the content of a cart with 2 articles

The cart ID must be identical to the ID present in the order content tag; if not, the cart will be considered as abandoned. Please also remember, the ID used for the cart must be unique and should never be reused, in order to avoid inconsistencies in your analyses.