## Overview

You can track a customer's Affirm checkout with any analytics tool that uses the query string to persist UTM parameters. Simply pass those parameters via `user_confirmation_url` and `user_cancel_url` when you define the Affirm [checkout object](🔗)).

## Add Affirm checkout to analytics tools

The URL defined in `user_confirmation_url` is where the customer is redirected to after completing the Affirm checkout flow. The URL defined in `user_cancel_url` is where the customer is redirected to if they exit the process without successfully confirming a loan (e.g., declination, cancellation).

**Example**



After successfully or unsuccessfully completing the process, the customer is redirected back to the proper URL with the persisting query string that was present before initiating the Affirm checkout. If you don't include the UTM parameters, they won't be included in the POST request back to your site.

## Google Analytics (analytics.js)

If you're using [the current Google Analytics implementation with analytics.js](🔗), you need to do one of the following to prevent affirm.com from being listed as a traffic source:

  • Use [Multi-Channel Funnel (MCF) reporting](🔗) to capture multiple referrers and sources for a given user session, which allows you to see original referrer and source information

  • Add affirm.com to your referral exclusion list to maintain the original traffic source

**Referral exclusion list**

You should only use [the referral exclusion list](🔗) if you can't use MCF. Since Affirm can drive traffic to your site directly from the Affirm User Portal, Google may track it as a legitimate traffic source for some transactions. By adding the affirm.com domain to you referral exclusion list, you won't track Affirm.com as a traffic source. The source information for the referring domain will appear as (direct/none)in your GA report as per [Google documentation](🔗)

From Google's documentation, "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."

For example, when a customer:

1\. Finds your store from an organic Google search result 2\. Shops on your site 3\. Completes the checkout on affirm.com 4\. Returns to your site

Google won't trigger a new session and retain the organic search result as the original traffic source. If a customer generates 2 sessions by leaving and returning to your site over 30 minutes later, then you'll still see the last non-direct click for the customer's recent sessions.

## Legacy Google Analytics (ga.js)

The [legacy Google Analytics implementation](🔗) requires that you manually override the traffic sources associated with the customer session using the `utm_nooverride` parameter.

Implement the `utm_nooverride` parameter on the first link at the referral source that a customer clicks. You don't need to include it in user_confirmation_url or user_cancel_url. As long as the customer's first visit to your site has the `utm_nooverride=1` parameter, all subsequent referrals will be ignored, and will not override the original traffic source.

[Consider upgrading to Google Universal Analytics](🔗) as it has several advantages, including multi-channel funnel analytics, which circumvents many of the challenges associated with source and referrer attributions.