Triggering Page View Pixels - Android

👍

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

Individual Page View Pixels are triggered on different screens of your app. Add the code snippet given below for each Pixel to where the screen’s logic is written, to trigger it on the relevant screen. Make sure that they are triggered from the onResume() method of the Activity or Fragment.
For detailed information on any of the Page View Pixels or where you should trigger it, refer to this guide.

Global Page View Pixels

PixelTracker.pageViewPixel(
  ref= "http://merchantname.app/product",
  title = "Home Page",
)

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

ParameterDescription
refSynthetic URL from referrer screen
titleThe screen name of the app view

Product Page View Pixel

PixelTracker.productPageViewPixel(
  ref= "http://merchantname.app/product/prodId",
  title = "Product Page",
  prodId = "prodId",
  prodName = "prodName",
  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 that identifies 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

Content Page View Pixel

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

PixelTracker.contentPageViewPixel(
  ref= "http://merchantname.app/pageName",
  title = "Content Page",
  catalogs = catalogs,
  itemId = "itemId",
  itemName = "itemName"
)

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
catalogsList of CatalogItem objects that are shown on the screen. In case the screen has multiple tabs, only the catalogs of the selected (and visualized) tabs should be included.
If multiple catalogs are shown in the active screen (or tab) all of them should be included.

The CatalogItem object has the following parameters:
name - Catalog Name
viewIds - A unique ID for a specific view of your product catalog. View IDs are decided by Bloomreach and you at the time of integration. This can have Single or Multiple IDs.
itemIdUnique ID of the item being shown on the screen. This identifier should match the item_id as specified in the content feed
itemNameName or Title of the content item

Content Page View Pixel

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

PixelTracker.contentSearchPageViewPixel(
  ref= "http://merchantname.app/pageName",
  title = "Content Search Page",
  catalogs = catalogs,
  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
catalogsList of CatalogItem objects that are shown on the screen. In the case the screen has multiple
tabs, only the catalogs of the selected (and visualized) tabs should be included.
If multiple catalogs are shown on the active screen (or tab) all of them should be included.

The CatalogItem object has the following parameters:
name - Catalog Name
viewIds - A unique ID for a specific view of your product catalog. View IDs are provided by Bloomreach and you at the time of integration. This can have Single or Multiple IDs.
searchTermThe value of the search query that was executed

Category Search Page View Pixel

PixelTracker.categoryPageViewPixel(
  ref= "http://merchantname.app/pageName",
  title = "Category Search Page",
  category = "catName",
  categoryId = "catId"
)

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
categoryIdUnique category ID as referred to in the catalog
categoryThe full breadcrumb path of the category, separated by pipe (|). Value needs to match the crumb value in your feed. eg: If the Crumb path is “Home > Clothing > Outerwear”, you’ll enter "Home|Clothing|Outerwear"

Search Result Page View Pixel

PixelTracker.searchResultPageViewPixel(
  ref= "http://merchantname.app/pageName",
  title = "Search Result 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 for this screen

Conversion Page View Pixel

val basket = ArrayList<PixelBasketItem>()
basket.add(PixelBasketItem(prodId = "prodId", name = "name", sku = null, "1", price = "123"))

PixelTracker.conversionPageView(
  ref= "http://merchantname.app/pageName",
  title = "Product Page",
  isConversion = true,
  basketValue = "123",
  orderId = "orderId",
  basket = basket
)

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

ParameterDescription
refSynthetic URL from referrer screen
titleThe Screen name of the app view
isConversionSet to true to indicate this is a Conversion screen or Order confirmation screen
basketValueThe total price of the checkout basket including tax, discounts, shipping and/or discounts in the account currency
orderIdThe order ID associated with the order placed
basketList of the PixelBasketItem objects (Products purchased).

The PixelBasketItem object has the following parameters:
prodId - Product ID of the purchased product
name - Name of the purchased product
sku - SKU number of the purchased product
quantity - Purchased quantity of the product
price - Price for the product