> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Preserve Precheck referrer attribution

Precheck is an interstitial page that redirects the visitor to your application after the check completes, which reloads the webpage. Because of this, the original referrer is not preserved, so your web analytics tool, such as Google Analytics or Adobe Analytics, may attribute referred first-time visitors that encounter Precheck as direct traffic. However, you can preserve the referrer attribution by using one of the following methods:

> **Note**
>
> Only one method is necessary. If you enable both, then the UTM parameters method takes precedence.

* [Restore the referrer (recommended)](#restore-the-referrer-recommended): Stores the original external referrer when the user encounters Precheck and restores it after the check completes. We recommend using this method whenever possible since it preserves the native analytics attribution behavior and is generally easier to implement.
* [Add UTM parameters](#add-utm-parameters): Appends UTM parameters to the post-Precheck URL based on the original referrer.

### Restore the referrer (recommended)

During the Precheck flow, HUMAN preserves the original external referrer before any navigation or reload occurs and stores it in `sessionStorage` under the `px_referrer` key. When `px_referrer` is present, the script reads and removes the stored value, then uses it to override `document.referrer` for the current page. When the key is absent, the browser's normal `document.referrer` behavior stays in place. Client-side analytics tools that read `document.referrer` then apply their existing attribution and classification logic.

To preserve the original referrer after Precheck, add the following script to **all pages that are protected by Precheck.** Alternatively, you can include it on all pages. This script only takes effect when a preserved `px_referrer` value is present after a Precheck flow.

> **Note**
>
> This script must be included at the beginning of `<head>` so that it executes before any tag manager, analytics library, or other client-side code that may read `document.referrer`.

```html
<script>
   (function () {
      try {
          var referrer = sessionStorage.getItem('px_referrer');
          if (!referrer) return;
          Object.defineProperty(document, 'referrer', {
              configurable: true,
              get: function () {
                  return referrer;
              }
          });
          sessionStorage.removeItem('px_referrer'); 
      } catch (e) {}
   })();
</script>
```

### Add UTM parameters

HUMAN can write the referral information into UTM query parameters.

* If a referrer is present, HUMAN sets `utm_source` to the domain (such as `www.example.com`) and `utm_medium` to `referral`.
* If a referrer is absent, HUMAN sets `utm_source` to `direct` and `utm_medium` to `none`.

> **Note**
>
> If the URL already contains UTM parameters, HUMAN leaves those parameters unchanged.

1. Navigate to **Sightline Cyberfraud Defense > Settings > Mitigation > Precheck Settings.**
2. Under **Precheck Configuration > Precheck Enablement**, click the **Preserve referral information in UTM parameter** checkbox to enable the setting.
3. Configure your analytics channel grouping or attribution rules to classify traffic based on the `utm_source` and `utm_medium` values added by HUMAN. The setup depends on your analytics platform. For example, in Google Analytics, you can use [Custom channel groups](https://support.google.com/analytics/answer/13051316).