Triggering Event Pixels - iOS
Make sure you have completed the steps mentioned in the main iOS 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 click/tap action of the relevant view or button.
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.shared.addToCartEventPixel(
ref: "http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses",
title: "Blue%20Lace%20Dress",
prodId: "prodId",
prodName: "prodName",
sku: "sku"
)
Here is a list of the different parameters you can use to configure the pixel:
Parameter | Description |
---|---|
ref | Synthetic URL from referrer screen |
title | Screen name of the app view |
prodId | This is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed |
prodName | The name of the product being added to cart |
sku | Unique 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.shared.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:
Parameter | Description |
---|---|
ref | Synthetic URL from referrer screen |
title | Screen name of the app view |
searchTerm | The value of the search query that was executed |
catalogs | List of CatalogItem objects that are shown on the screen |
Suggest Event Pixel
PixelTracker.shared.suggestionEventPixel(
ref: "http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses",
title: "Blue%20Lace%20Dress",
prodId: "prodId",
prodName: "prodName",
sku: "sku",
typedTerm: "typed",
searchTerm: "test"
)
Here is a list of the different parameters you can use to configure the pixel:
Parameter | Description |
---|---|
ref | Synthetic URL from referrer screen |
title | Screen name of the app view |
prodId | This is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed |
prodName | The name of the product being viewed |
sku | Unique SKU ID that represents the selected variant of this product. If your site does not have SKUs, leave this blank |
typedTerm | The displayed query (the one or more letters) that the user has actually typed. This is NOT the suggested word or phrase |
searchTerm | The 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
PixelTracker.shared.quickViewEventPixel(
ref: "http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses",
title: "Blue%20Lace%20Dress",
prodId: "prodId",
prodName: "prodName",
sku: "sku"
)
Here is a list of the different parameters you can use to configure the pixel:
Parameter | Description |
---|---|
ref | Synthetic URL from referrer screen |
title | Screen name of the app view |
prodId | This is the unique ID which describes a product or product collection. This identifier should match the ID as specified in the product catalog feed |
prodName | The name of the product being viewed |
sku | Unique SKU ID that represents the selected variant of this product. If your site does not have SKUs, leave this blank |
Updated 11 months ago