Skip to main content

Merchant Help


Affirm Merchant Help

User Analytics

If you have existing user analytics that uses the query string to persist UTM parameters, you can pass those UTM parameters through via the user_confirmation_url and user_cancel_url that are defined when Affirm checkout is initiated:


required url. The user is redirected to this address upon successfully completing the Affirm checkout flow.

Affirm will POST (by default, GET is optional) the checkout_token to this URL so it can used to authorize the charge.


required url. The user is redirected to this address upon leaving the Affirm application in any unhappy path scenario (decline, bail, etc).


The final user_confirmation_url or user_cancel_url would look like:


"merchant" : {
        "user_confirmation_url" : your_confirmation_url + "?your_analytics_tag=" + some_value,
        "user_cancel_url" : your_cancel_url + "?your_analytics_tag=" + some_value



After the user confirms their Affirm loan,  they are redirected back to the user_confirmation_url, there by persisting the query string that was present before the Affirm checkout was initiated. If you do not include the UTM parameters in the user_confirmation or user_cancel URL, those parameters will not be included in the POST request (redirect) back to your site when the user either confirms their loan, or exits for any other reason.

Modern vs Legacy Google Analytics implementation

Modern (analytics.js)

With the modern Google Universal Analytics implementation, you will need to either:

  • Add to the referral exclusion list to maintain the original traffic source
  • Utilize Multi-Channel Funnel (MCF) reporting to see multiple referrals/sources for a given user session.

analytics.js documentation

Multi-Channel Funnel Analytics

Google Universal Analytics are able to capture multiple referrers and sources for a given user session, which allows you to see original referrer/source information without explicitly blocking/overriding new sources from being attributed.

MCF documentation

Referral Exclusion List

This should be implemented only if the above MCF analytics cannot be utilized or is insufficient. Affirm can drive traffic to your site directly from the Affirm User Portal, which would make Affirm a legitimate traffic source for some transactions. By adding the domain to the referral exclusion list, you will not be able to track as a traffic source.

From the Google Universal Analytics docs:

"A common use for this feature is to prevent third-party shopping carts from starting second sessions. When the third-party shopping cart is in the exclusion list, a user will no longer initiate a new session, and won't be counted as a referral when they return to your order-confirmation page after checking out on the third-party site."

Example timeline:

  1. User visits your site from an organic Google search result
  2. User checkouts out using Affirm (user is on for < 30 minutes)
  3. User finishes Affirm checkout and returns back to your site (not past 12AM)
  4. Affirm is on the referral exclusion list, so Google won't use the new referrer to trigger a new session.
  5. Google will retain the original traffic source attribution (organic Google search) since the original session is resumed.

If two sessions are generated because the user left your site for >30 minute, you will still see the last non-direct click for the user's recent sessions.

Referral exclusion documentation


This parameter is deprecated for modern Google Universal Analytics.

Previously this parameter was needed so that the user's traffic source would not be updated during a given session (retains the original source). However, recent updates to Google analytics makes this unnecessary, since intermediate referrals (like to/from no longer override/update the user's originally recorded traffic source.

Legacy (ga.js)

The legacy Google Analytics implementation requires that you manually override the traffic sources that are associated with a particular user's session. This can be done using the utm_nooverride parameter.

ga.js documentation

Documentation about traffic sources


The utm_nooverride parameter should be implemented on the first link that a user clicks on, but does not need to be included for Affirm confirmation_url and cancel_url. As long as the user's first visit to your site has the 'utm_nooverride=1' parameter, all subsequent referrals will be ignored, and will not update the original traffic source that was recorded. This should be implemented at the first link (at the referral source), and not further down the funnel.


Upgrading to Google Universal Analytics has several advantages, including the available mult-channel funnel analytics, which circumvents many of the challenges associated with source and referrer attribution.

Google article on upgrading from their legacy to modern analytics library