Triggering Event Pixels - Android

👍

Make sure you have completed the steps mentioned in the main Android Application Pixel Integration guide before going through this page.

Trigger Event Pixels whenever the visitor performs an action. Add the code snippet given below for each Event Pixel in the onClick() method of the relevant view or button where the tap/click action happens on the screen.
For detailed information on any of the Event Pixels or where you should trigger it, refer to this guide.

Add To Cart Event Pixel

PixelTracker.addToCartEventPixel(
  ref= "http://merchantname.app/pageName",
  title = "Product Page",
  prodId = "prodId",
  prodName = "prodName",
  sku = "sku"
)

Here is a list of the different parameters you can use to configure the pixel:

ParameterDescription
refSynthetic URL from referrer screen
titleScreen name of the app view
prodIdThis is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed
prodNameThe name of the product being added to cart
skuUnique SKU ID that represents the selected variant of this product. If your site does not have SKUs, leave this blank
prodCollectionId
(Optional)
When a product is added to cart from a Product Collection screen, pass the ID of that collection to prod_collection_id.
No need to set the prod_collection_id parameter in the ATC event pixel when a product is added to cart from its own screen, independent of any Product Collection it is part of

Search Event Pixel

PixelTracker.searchEventPixel(
  ref= "http://merchantname.app/pageName",
  title = "Product List Page",
  searchTerm = "test"
)

Here is a list of the different parameters you can use to configure the pixel:

ParameterDescription
refSynthetic URL from referrer screen
titleScreen name of the app view
searchTermThe value of the search query that was executed
catalogsList of CatalogItem objects that are shown on the screen

Suggest Event Pixel

val catalogs = ArrayList<CatalogItem>()
catalogs.add(CatalogItem("cat1"))

PixelTracker.suggestionEventPixel(
  ref= "http://merchantname.app/pageName",
  title = "Product List Page",
  prodId = "prodId",
  prodName = "prodName",
  sku = "sku",
  typedTerm = "te",
  searchTerm = "test"
)

Here is a list of the different parameters you can use to configure the pixel:

ParameterDescription
refSynthetic URL from referrer screen
titleScreen name of the app view
prodIdThis is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed
prodNameThe name of the product being viewed
skuUnique SKU ID that represents the selected variant of this product. If your site does not have SKUs, leave this blank
typedTermThe displayed query (the one or more letters) that the user has actually typed.
This is NOT the suggested word or phrase
searchTermThe site visitor’s typed search query submitted to the search box
catalogs
(Optional)
List of CatalogItem objects that are shown on the screen

Quick View Event Pixel

val catalogs = ArrayList<CatalogItem>()
catalogs.add(CatalogItem("cat1"))

PixelTracker.quickViewEventPixel(
  ref= "http://merchantname.app/pageName",
  title = "Product List Page",
  prodId = "prodId",
  prodName = "prodName",
  sku = "sku"
)

Here is a list of the different parameters you can use to configure the pixel:

ParameterDescription
refSynthetic URL from referrer screen
titleScreen name of the app view
prodIdThis is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed
prodNameThe name of the product being viewed
skuUnique SKU ID that represents the selected variant of this product. If your site does not have SKUs, leave this blank