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

promotion
required

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

promotion
required

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

creativeId
optional

string
Maximum length: 500
Protocol parameter: pmmc

An identifier for the creative used by the promotion.

message
optional

string
Maximum length: 500
Protocol parameter: pmms

The messaging used in the promotion.

position
optional

string
Maximum length: 500
Protocol parameter: pmpo

An identifier indicating where within the website the customer viewed the promotion (e.g. top_home).

*promotionId
optional

string
Maximum length: 500
Protocol parameter: pmpi

A unique identifier of the promotion the customer viewed.


Did this page help you?