> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cutmeshort.com/llms.txt
> Use this file to discover all available pages before exploring further.

# First-Click vs Last-Click

> Understand how cms_rf cookie attribution works, the difference between first-click and last-click models, and which one is right for your tracking strategy.

## What is Attribution?

When a user visits your site, they rarely come from a single source. They might discover your product through a Google Ad, leave, come back from an email campaign, and finally convert through a direct visit. **Attribution** is how you decide which of those touchpoints gets the credit for the conversion.

The CMS script’s `cms_rf` parameter-based cookie system is a lightweight, first-party implementation of this concept no third-party dependencies, no cross-domain complexity, just clean URL-parameter tracking stored directly in the browser.

> [!NOTE]
>
> The CMS script uses **last-click attribution** by default.

## How the `cms_rf` Cookie System Works

On page load, the CMS script checks the URL for the `cms_rf` parameter. If present, it runs attribution logic that either sets the cookie for the first time or updates an existing value.

**1. User arrives on site**

The user clicks a link with `?cms_rf=google_cpc` appended to the URL (e.g., from a paid ad, email, or affiliate link).

**2. Script detects cms\_rf**

The CMS script reads the `cms_rf` value from url on page load.

**3. Cookie logic runs**

Based on the attribution model, the script either **sets** the cookie (if not set) or **overwrites** it (if already set).

**4. Cookie is sent with conversion**

When the user completes a conversion event, the `cms_rf` cookie value is read and passed along to your analytics or CRM system.

> [!NOTE]
>
> The `cms_rf` cookie is a **first-party cookie**, which means it lives in the user's browser under your own domain. This makes it more reliable than third-party tracking pixels in an era of increasing browser privacy restrictions (Safari ITP, Firefox ETP, etc.).

## First-Click Attribution

In **first-click**, the first touchpoint that introduced the user is retained. Once the `cms_rf` cookie is set, it is **not overwritten** even if the user returns later with a different `cms_rf` value.

### Example scenario

| Visit | URL Parameter | Cookie Value (First-Click) |
| - | - | - |
| 1st | `cms_rf=google_cpc` | `google_cpc` ✅ Set |
| 2nd | `cms_rf=email_newsletter` | `google_cpc` 🔒 Locked |
| 3rd | `cms_rf=referral_partner` | `google_cpc` 🔒 Locked |

> [!TIP]
>
> First-click is most useful when the initial discovery channel is the signal you want to report on (often longer consideration cycles like SaaS, B2B, or high-ticket products).

### When to use First-Click

* You want to understand what **drives awareness** and top-of-funnel traffic.
* You want credit to remain with the first recorded source across return visits.
* Your customer journey typically spans multiple sessions before conversion.

## Last-Click Attribution

In **last-click**, the most recent touchpoint is retained. Every time a user arrives with a new `cms_rf` value, the cookie is overwritten. So the stored value reflects the last channel seen before converting.

### Example scenario

| Visit | URL Parameter | Cookie Value (Last-Click) |
| - | - | - |
| 1st | `cms_rf=google_cpc` | `google_cpc` ✅ Set |
| 2nd | `cms_rf=email_newsletter` | `email_newsletter` 🔄 Updated |
| 3rd | `cms_rf=referral_partner` | `referral_partner` 🔄 Updated |

> [!TIP]
>
> Last-click is most useful when the final converting touchpoint is the signal you want to report on (often performance and conversion-focused workflows).

### When to use Last-Click

* You want to know what **closes deals** and drives final conversions.
* You want the attribution value to reflect the most recent recorded source before conversion.
* Your customer journey is short and straightforward.

## Which Model is Better?

There’s no universally “better” model. Each answers a different question.

> [tab] First-Click
>
> * Your primary marketing goal is **brand discovery and awareness**
> * You run significant spend on top-of-funnel channels (paid search, content, social) and need to justify ROI
> * Your conversion cycle is **30+ days**
> * You're trying to understand what channel to invest in to grow your audience

> [tab] Last-Click
>
> * Your primary goal is **conversion optimization**
> * You run retargeting, promotional email, or affiliate campaigns that directly push users to convert
> * Your conversion cycle is **long**
> * You're a performance marketer who needs to optimize channel spend by conversion volume

## Summary

| Type | First-Click | Last-Click |
| - | - | - |
| **Cookie set** | Once only | Every new `cms_rf` |
| **Cookie overwritten** | Never | Always |
| **Credits** | Original source | Most recent source |
| **Best signal** | Awareness & discovery | Conversion & closing |
| **Cookie expiry strategy** | Longer (60–90 days) | Longer (60–90 days) |
| **Complexity** | Low | Low |

Both models are simple, privacy-friendly, and effective when used for the right purpose. The most important thing is to **choose deliberately** based on your analytics goals and document which model is active so your team interprets the data correctly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.