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

# Purchase Event Attribution

> Learn how Upstack Data attributes purchases to specific ad clicks using First Paid Click, Last Paid Click, and First and Only Paid Click models for optimized CAPI forwarding.

Purchase Event Attribution automatically analyzes the marketing touchpoints (ad clicks) that led to a purchase and fires platform-specific events for CAPI optimization.

## How it works

When a purchase event occurs, Upstack Data looks back at the user's click history and identifies:

1. **First Paid Click (FPC)**: The first paid ad click in the user's journey
2. **Last Paid Click (LPC)**: The most recent paid ad click before purchase
3. **First and Only Paid Click (FOPC)**: Fires when there was exactly one paid ad click

These attributed events are then forwarded to the relevant ad platforms via CAPI, allowing you to optimize campaigns based on different attribution models.

## Attributed events by platform

| Platform   | First Paid Click        | Last Paid Click         | First & Only Click       |
| ---------- | ----------------------- | ----------------------- | ------------------------ |
| Google Ads | `fpc_google_purchase`   | `lpc_google_purchase`   | `fopc_google_purchase`   |
| Meta Ads   | `fpc_meta_purchase`     | `lpc_meta_purchase`     | `fopc_meta_purchase`     |
| TikTok Ads | `fpc_tiktok_purchase`   | `lpc_tiktok_purchase`   | `fopc_tiktok_purchase`   |
| Applovin   | `fpc_applovin_purchase` | `lpc_applovin_purchase` | `fopc_applovin_purchase` |

<Note>
  Google Ads attribution is currently available. Meta, TikTok, and Applovin support is coming soon.
</Note>

## Lookback window

The lookback window determines how far back Upstack Data searches for qualifying ad clicks before a purchase. You can configure this in your [Pixel Settings](https://app.upstackdata.com/settings/pixel).

| Option                 | Description                                      |
| ---------------------- | ------------------------------------------------ |
| **Lifetime** (default) | Searches the entire user journey for paid clicks |
| **7 days**             | Only considers clicks within 7 days of purchase  |
| **14 days**            | Only considers clicks within 14 days of purchase |
| **28 days**            | Only considers clicks within 28 days of purchase |
| **30 days**            | Only considers clicks within 30 days of purchase |
| **60 days**            | Only considers clicks within 60 days of purchase |
| **90 days**            | Only considers clicks within 90 days of purchase |

<Tip>
  For most stores, **Lifetime** provides the most complete attribution picture. Use shorter windows if your purchase cycle is typically quick and you want to focus on recent marketing impact.
</Tip>

## Configuring the lookback window

1. Go to [Pixel Settings](https://app.upstackdata.com/settings/pixel) in your Upstack dashboard
2. Find the **Purchase Event Attribution** section
3. Select your preferred lookback window from the dropdown
4. Click **Save Changes**

## Use cases

### Optimize Google Ads for first-touch attribution

Map the `fpc_google_purchase` event as a conversion action in Google Ads to optimize campaigns for acquiring new customers at the top of the funnel.

### Compare attribution models

Use both `fpc_*` and `lpc_*` events to understand which campaigns are better at:

* **Introducing** customers to your brand (high FPC attribution)
* **Closing** sales (high LPC attribution)

### Single-touch campaigns

The `fopc_*` events help identify purchases where a single ad click drove the entire journey, useful for measuring the effectiveness of one-shot campaigns.

## Related articles

<CardGroup cols={2}>
  <Card title="How to Setup UTM Parameters" href="/guides/attribution/how-to-setup-utm-parameters-for-upstack-data" />

  <Card title="Configure Google Ads Destination" href="/guides/google-ads/how-to-configure-google-ads-destination-in-upstack-data" />

  <Card title="Custom Event Mappings" href="/guides/custom-events/global-event-mappings" />

  <Card title="Events Manager" href="/get-started/verify-events" />
</CardGroup>
