Add-to-cart (ATC) Pixel

❗️

Events always occur on a page view, so you must pass the associated page view pixel information together with the event pixel.

Any time a user adds an item to their cart, Bloomreach's Add To Cart Event should fire. Typically this includes the product display page, product listing pages such as category or search pages as well as Quick Views. If an Add To Cart button is located anywhere else on your site (e.g. Product Collection pages) , please also fire this tag there as well. 

To get started, follow the steps given below:

1. Copy & paste the ATC Event Tracking Snippet & install on all of your ATC buttons. 
2. Map the ATC Event Variables in the ATC Tracking Snippet. Check the implementation scenarios for examples.

ATC Event Tracking Snippet for ATC Button

BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': '<Product ID>', 'sku' : '<Sku ID>'});

ATC Event Variables

Variable

Value type, example

Description

prod_id

string, pid123456

This is the unique ID, which describes a product or product collection. If a product is available in multiple SKUs (e.g. color/size combinations), this field refers to the id shared by all the SKUs for a product.

Needs to match Product ID sent in feed, and the prod_id in the Conversion Page View Pixel.

sku

string, sku38738

Unique SKU id that representing the selected variant of this product
(e.g. size M, color blue of a t-shirt). Needs to match SKU ID sent in feed

If your site does not have SKUs, leave this blank.

Implementation Scenarios

ScenarioExamples
ATC on a Product Detail Page (PDP) with a product ID and a Sku IDIf your product ID is prod1234 and the sku ID is sku38738, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'pid12456', 'sku' : 'sku38738'});
ScenarioExamples
ATC on a Product Detail Page (PDP) with a product ID but no Sku IDIf your product ID is prod1234, but there is no Sku, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'pid12456', 'sku' : ''});
ScenarioExamples
ATC on a Product Collection page with a unique collection IDIf your Product Collection page has their own unique ID and is sold exactly like a standalone product, enter the collection ID.

If your collection ID is collection5678, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'collection5678', 'sku' : ''});
ScenarioExamples
ATC on a Quick ViewIf your site has an ATC button on a Quick View pop-up for an individual product and the product ID is prod1234, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'prod1234', 'sku' : ''});

If you sell Collections, you can implement the pixel in several different ways. The table below outlines multiple scenarios and the pixel requirements for each.

ScenarioExamples
Product Collections have their own unique ID and are sold exactly like standalone productsIf your Product Collection page has their own unique ID and is sold exactly like a standalone product, enter the collection ID.

If your collection ID is collection5678, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'collection5678', 'sku' : ''});

Scenario

Examples

Product Collections have their own unique ID, but
cannot be purchased as a whole. Only individual products can be purchased

Call the ATC Event for each individual product added to the cart.
If your Product Collection Page has an Add all ATC button, an ATC event for each single product added to the cart needs to be fired.

Example 1:
Your collection ID is collection5678 and a user adds two individual products with product ID product1234 and product5678  in the cart, then two ATC events need to be fired. 

The ATC event for the first product should look like:

BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product1234', 'sku' : ''});

The ATC event for the second product should look like:

BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product5678', 'sku' : ''});

Example 2:
Your collection ID is collection5678 and by clicking an Add all ATC button, product1234 and product5678  are added to the cart. Two ATC events need to be fired from the Add all ATC button:

BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product1234', 'sku' : ''});
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product5678', 'sku' : ''});

Alternatively, fire a single ATC event with a comma-separated list of product IDs:

BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product1234, product5678', 'sku' : ''});
ScenarioExamples
Products that are a part of a Collection but can be purchased from their own individual product pageIf your Product Collection page has their own unique ID and is sold exactly like a standalone product, enter the product ID.

If your product ID is product1234, your ATC event should look like:
BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': 'product1234', 'sku' : ''});

Implementation Example

ScenarioImplementation Example
ATC handler in your HTML codeATC Event Snippet to add into an HTML element
<a href="#" onClick="BrTrk.getTracker().logEvent('cart', 'click-add', {'prod_id': '<Product ID>', 'sku' : '<Sku ID>'})>

Native App Implementation

You can include the Global View variables and the following variables for ATC events. For details on the native app implementation format, refer to the Non-JS Environment section in the Getting Started page. 

  • type
  • group
  • etype
  • prod_id (see above)
  • prod_name
  • sku (see above)

Refer to the Implementation Scenarios above for specific use cases of prod_id and sku.

NameVariableExampleDescription
Tracking TypetypeThe type of tracking fire. For events, type=event
Group TypegroupSpecifies the event grouping. Must not be empty.

For ATC events, group=cart
Event Action TypeetypeSpecifies the event's action type. Must not be empty.

For ATC events, etype=click-add
Product nameprod_nameBlue%20Lace%20DressThe name of the product being viewed.

Example requests:

https://p.brsrvr.com/pix.gif?
acct_id=6702
&cookie2=uid%3D1e7724c751a3f6e6241018d150144832e7528383%3Av%3Dapp%3Ats%3D0%3Ahc%3D1
&rand=86838131966165760
&type=event
&title=Blue%20Lace%20Dress
&url=http%3A%2F%2Fmerchantname.app%2Fproduct%2Fblue%2520lace%2520dress
&ref=http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses
&group=cart
&etype=click-add
&ptype=product
&prod_id=prod1234
&prod_name=Blue%20Lace%20Dress
&sku=123-45
https://p.brsrvr.com/pix.gif?
acct_id=6702
&cookie2=uid%3D1e7724c751a3f6e6241018d150144832e7528383%3Av%3Dapp%3Ats%3D0%3Ahc%3D1
&rand=86838131966165760
&type=event
&title=Dresses
&url=http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses
&ref=http%3A%2F%2Fmerchantname.app%2Fhomepage
&group=cart
&etype=click-add
&ptype=category
&prod_id=prod1234
&prod_name=Blue%20Lace%20Dress
&sku=123-45
&cat=home%7Cdresses
&cat_id=dresses

Did this page help you?