Enhanced Analytics
Learn more about Affirm’s marketing measurement tools and the data you can provide to get more value from your partnership with Affirm over time.
Overview
The Enhanced Analytics plugin for the Affirm.js
library is a simple, easy-to-use tool allowing deeper integration with Affirm to measure customer interactions across your site. With Enhanced Analytics enabled, Affirm is better able to help you understand your customers’ financial preferences and tailor their shopping experiences accordingly.
How it works
As a user navigates between web pages, Affirm.js records information about their session. This includes discrete events for tracking product impressions, viewing product details, adding to or removing from the shopping cart, initiating the checkout process, and completing a purchase.
The most important signal that Affirm can use to help you increase the value of your integration comes from order confirmation data; as a result, sending this event type is the only requirement in integrating Enhanced Analytics.
Sending confirmation events
The trackOrderConfirmed
function accepts basic data about each confirmed customer order from your confirmation page and sends the details to Affirm’s improved data pipeline for use in our analytics tools.
Implementation
1. Add the Affirm.js
SDK to the confirmation page (Affirm.js may already be loaded on all site pages for some merchants)
2. Upon load of the confirmation page, prepare the following data to be passed to the trackOrderConfirmed
function.
Order
object - JSON object containing the following details:
3. Call the trackOrderConfirmed
function and provide the previously gathered data as the parameters. We included an example call below.
affirm.analytics.trackOrderConfirmed({
"currency": "USD",
"orderId": "AA-87654",
"paymentMethod": "Affirm",
"total": 23595
}, null, true);
Passing the null value
You can pass
null
in second required parameter. This was formerly theproduct
array in our Legacy Enhanced Analytics. If you keep the existing parameters to include theproduct
array, we'll simply ignore the value and treat it asnull
.
Passing the true value
The true value in the third parameter is also required
Objects
Order
The order object should contain the following details:
Updated 3 months ago