Promotion events
Overview
Promotion events help you gather analytics on offers within your eCommerce website. Our enhanced analytics automatically tracks promotional information displayed by Affirm without any additional integrations.
trackPromotionViewed(Promotion)
This event is triggered when a customer views a promotion.
Parameters
Parameter | Data type | Description |
---|---|---|
| object | The promotion the customer viewed. |
Example
affirm.analytics.trackPromotionViewed({
"creativeId": "promo_summer_sale_2100_variant1",
"Message": "T-Shirt Sale 75% Off",
"Position": "home_hero",
"promotionId": "promo_summer_sale_2100"
});
trackPromotionClicked (Promotion)
This event is triggered when a customer clicks on a promotion.
Parameters
Parameter | Data type | Description |
---|---|---|
| object | The promotion the customer clicked. |
Example
affirm.analytics.trackPromotionClicked({
"creativeId": "promo_summer_sale_2100_variant1",
"Message": "T-Shirt Sale 75% Off",
"Position": "home_hero",
"promotionId": "promo_summer_sale_2100"
});
Objects
Promotion
Represents a promotion present on the eCommerce website, with or without creatives. Functions using a promotion to support multiple products to be associated with the promotion.
Parameter | Data type | Description |
---|---|---|
| string | An identifier for the creative used by the promotion. |
| string | The messaging used in the promotion. |
| string | An identifier indicating where within the website the customer viewed the promotion (e.g. top_home). |
*promotionId | string | A unique identifier of the promotion the customer viewed. |
Updated about 1 year ago