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

# Track Meta Ads to Shopify with ClickFlare and Triple Whale

> Route Meta ad clicks through ClickFlare to your Shopify store, pass the UTMs and tw_ parameters Triple Whale needs, and keep every Shopify order traceable to a ClickFlare click.

Many Shopify brands run ClickFlare and Triple Whale side by side. ClickFlare owns the click: it receives the visitor from the Meta ad, records the ad, ad set, campaign and placement, rotates landers or stores, and redirects to Shopify. Triple Whale owns the store-side attribution: its pixel reads the UTMs and `tw_` parameters on the Shopify landing URL and ties orders back to Meta ads.

The two tools only agree when ClickFlare **rebuilds the parameters on the way out**. Meta sends its values to ClickFlare, not to your store. Anything Triple Whale or Shopify needs must be written into the ClickFlare offer URL with ClickFlare tokens.

This guide covers the full setup for Meta traffic, how to make every order traceable to a ClickFlare click, and how to debug orders whose UTMs do not match what ClickFlare sends.

***

## How the data flows

```text theme={null}
Meta ad click
  → https://track.yourbrand.com/cf/r/CAMPAIGN?ad_id=123&ad_name=Hook-A&...&fbclid=XYZ
     (ClickFlare records the click and stores ad_id, ad_name, ... in tracking fields)
  → [optional lander → CTA uses the ClickFlare click URL]
  → https://yourstore.com/products/x?utm_content=Hook-A&tw_adid=123&fbclid=XYZ&click_id=CF_CLICK_ID&...
     (Shopify, Triple Whale pixel and Meta pixel read the parameters here)
  → Order → Shopify webhook → ClickFlare sale conversion (same click ID)
```

Two rules follow from this:

* **Meta → ClickFlare:** Meta's dynamic macros go in the Meta ad's **URL parameters** field and land in ClickFlare's tracking fields.
* **ClickFlare → Shopify:** the offer URL rewrites those tracking fields into the parameter names Shopify and Triple Whale read. If a parameter is not in the offer URL, it does not reach the store.

> [!NOTE]
>
> Same mirror as any offer: **Offer URL = their parameter + your token.** Here "their parameter" is a UTM or `tw_` name, and "your token" is a ClickFlare tracking field.

***

## What the Meta template stores

ClickFlare's Meta (Facebook) traffic source template maps Meta macros to these tracking fields. You need them to build the offer URL.

| Meta macro | Parameter on the ClickFlare link | ClickFlare token |
| - | - | - |
| `{{ad.id}}` | `ad_id` | `{trackingField1}` |
| `{{adset.id}}` | `adset_id` | `{trackingField2}` |
| `{{campaign.id}}` | `campaign_id` | `{trackingField3}` |
| `{{ad.name}}` | `ad_name` | `{trackingField4}` |
| `{{adset.name}}` | `adset_name` | `{trackingField5}` |
| `{{campaign.name}}` | `campaign_name` | `{trackingField6}` |
| `{{site_source_name}}` | `source` | `{trackingField7}` |
| `{{placement}}` | `placement` | `{trackingField8}` |
| fbclid (added by Meta) | `fbclid` | `{external_id}` |

![The Facebook template's Parameters table in ClickFlare: fbclid is stored as external\_id, and ad\_id to placement map to trackingField1 to trackingField8](https://mintcdn.com/clickflare/AwhvqEsa3nT2enN3/images/integrations/shopify-triple-whale/meta-traffic-source-parameters.png?fit=max\&auto=format\&n=AwhvqEsa3nT2enN3\&q=85\&s=e64fcd5531e27d5c4d917ae7e9cc6d6d)

> [!WARNING]
>
> `{trackingField1}` is the **ad ID** and `{trackingField4}` is the **ad name**. Swapping them is the most common reason a UTM shows an ID where a name was expected. Check the mapping in your own traffic source if you edited the template.

***

## Setup

Everything below is done from inside the campaign editor. Create the traffic source and offer inline as you go.

**1. Set up your own tracking domain**

Add a custom tracking domain before anything else (for example `track.yourbrand.com`). Shared domains get flagged by Meta, and a domain on your own brand reads better in the ad preview. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Create the campaign and pick redirect tracking**

Go to **Campaigns → New Campaign** and choose **Redirect tracking**. The ad points to the ClickFlare campaign URL, and ClickFlare redirects to Shopify.

Use **302** as the transition mode unless you have a reason not to. See [Transition modes](/docs/en/tracking/clickflare-transition-modes.md).

> [!NOTE]
>
> With **direct tracking**, the ad points straight at Shopify and ClickFlare never rewrites the URL. The store then receives only what Meta's URL parameters field contains. Everything in "Build the offer URL" below does not apply in that mode.

**3. Create the Meta traffic source inline**

In the campaign's traffic source field, create a new source from the **Facebook** template. Keep the default parameters (table above), set the currency, and connect the [Meta cost integration](/docs/en/integrations/facebook-1.md) so spend is pulled per ad.

**4. Create the Shopify offer inline and build the offer URL**

Create a new offer and paste the store page you want to send traffic to: home page, collection, product page (PDP) or a landing page. Then append the parameters below. A full example:

```text theme={null}
https://yourstore.com/products/your-product?utm_source=facebook&utm_medium=paid&utm_campaign={trackingField6}&utm_term={trackingField5}&utm_content={trackingField4}&utm_id={trackingField3}&tw_source={trackingField7}&tw_adid={trackingField1}&fbclid={external_id}&click_id={cf_click_id}&cpid={campaign_id}
```

![The New Offer form with the Shopify offer URL pasted in. The ClickFlare tokens used in the URL are highlighted in the token list below it](https://mintcdn.com/clickflare/AwhvqEsa3nT2enN3/images/integrations/shopify-triple-whale/offer-url-tokens.png?fit=max\&auto=format\&n=AwhvqEsa3nT2enN3\&q=85\&s=a3ed61c585a63fade3157252994326bf)

What each group does:

| Parameters | Read by | Purpose |
| - | - | - |
| `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `utm_id` | Shopify, Triple Whale | Campaign, ad set and ad names in Shopify's sessions and order attribution |
| `tw_source`, `tw_adid` | Triple Whale | The pair Triple Whale's Meta integration requires to attribute an order to an exact ad |
| `fbclid` | Meta pixel, Triple Whale | Lets the Meta pixel on Shopify build the click cookie. Without it, the redirect drops the click identifier Meta added |
| `click_id`, `cpid` | ClickFlare | Ties Shopify orders back to the ClickFlare click. Also your trace marker (see below) |

> [!TIP]
>
> The UTM-to-field assignment above is a convention, not a rule. Keep whatever convention the store already uses in Triple Whale and Shopify, and only change the ClickFlare tokens behind it. What matters is that `tw_adid` gets the **ad ID** and the name UTMs get **name** fields.

> [!WARNING]
>
> Use `{cf_click_id}` with braces. Without braces the store receives the literal text `cf_click_id` and orders cannot be matched.

**5. Add a lander (optional)**

If you send traffic through an advertorial, quiz or presell page first, the lander's CTA must use the **ClickFlare click URL**, not a Shopify link. Otherwise the visitor reaches the store without the offer URL parameters, and Triple Whale sees a click with no UTMs.

**6. Install the ClickFlare Shopify integration**

Add the ClickFlare script to `theme.liquid` and create the **Checkout creation** and **Order creation** webhooks. Full steps: [Shopify integration](/docs/en/integrations/how-to-track-your-shopify-store-with-click-flare-from-product-views-to-final-sale.md). This is what turns Shopify orders into ClickFlare `sale` conversions on the original click.

**7. Save and copy the campaign URL**

Save the campaign. In the **Tracking** tab, copy the campaign URL.

**8. Configure the Meta ad**

In Ads Manager, at ad level:

* **Website URL:** the ClickFlare campaign URL, with nothing appended.
* **URL parameters:** the parameter string from the ClickFlare Meta template:

```text theme={null}
ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}&ad_name={{ad.name}}&adset_name={{adset.name}}&campaign_name={{campaign.name}}&source={{site_source_name}}&placement={{placement}}
```

Do not put the UTMs or `tw_` parameters in Meta. ClickFlare adds them on the way to Shopify. Meta adds `fbclid` on its own.

**9. Send conversions back to Meta (optional)**

To report purchases to Meta server-side from ClickFlare, set up the [Meta Conversions API integration](/docs/en/integrations/facebook.md). If Shopify's own Meta channel or Triple Whale already sends purchases to the same pixel, decide which one owns the Purchase event so Meta does not count it twice.

***

## Verify the setup

**1. Click a real ad link**

Use the ad preview link from Ads Manager, or paste the campaign URL with sample values: `?ad_id=111&ad_name=Test-Ad&adset_name=Test-Set&campaign_name=Test-Campaign&source=fb&fbclid=test123`.

**2. Read the Shopify landing URL**

Check the address bar on the store. Every parameter from the offer URL should be there, with real values. A literal `{trackingField4}` or an empty value means the token is wrong or the incoming parameter is missing.

**3. Place a test order**

Use a test gateway or a 100% discount code.

**4. Check all three systems**

* **ClickFlare:** a `sale` conversion on the test click.
* **Shopify:** on the order page, the conversion summary shows the UTMs you sent.
* **Triple Whale:** the order is attributed to the Meta ad matching `tw_adid`.

> [!NOTE]
>
> If the campaign has several offers, paths or a rotation, test each one. A test that lands on one offer says nothing about the others.

***

## Trace every order back to ClickFlare

The `click_id={cf_click_id}` parameter does double duty. ClickFlare uses it to attribute the order, and you can use it as a marker: **an order whose landing URL has no ClickFlare click ID did not arrive through ClickFlare.**

Where to look:

> **In ClickFlare (most reliable)**
>
> With the Shopify integration installed, every order that came from a ClickFlare click shows up as a `sale` conversion on that click. Reconcile the two lists for a date range: an order in Shopify with no matching ClickFlare conversion did not carry a ClickFlare click into checkout.
>
> For a single suspect order, look up its click ID in ClickFlare and check the recorded tracking fields: the `ad_id` and `ad_name` Meta actually sent on that click.

> **In Shopify**
>
> Shopify keeps the landing page URL of the session that led to the order. Open the order, go to the conversion summary and view the conversion details. The landing URL shows every parameter on the visit, including `click_id`. Through the Admin API, the same URL is on the order's landing site field.

> **In Triple Whale**
>
> Triple Whale's pixel records the landing URL of each touchpoint in the customer journey. If the Meta touchpoint's URL has no `click_id`, that visit came from somewhere other than the ClickFlare redirect.

> [!TIP]
>
> If you want the marker visible in Shopify's standard UTM reports as well, put the click ID in a UTM the store does not use for anything else. Do not overwrite a UTM that Triple Whale or the store's reports already rely on.

***

## Troubleshooting: a UTM shows the ad ID instead of the ad name

ClickFlare writes exactly what the offer URL says. If the offer has `utm_content={trackingField4}` and manual tests send the ad name, ClickFlare cannot put an ad ID there on a real click. So when Shopify shows an ID, either the visit did not go through that offer URL, or it was attributed to a different visit. Work through these in order:

> **1. The click bypassed ClickFlare**
>
> Check for `click_id` on the order's landing URL (see above). If it is missing, the visitor reached the store through another link. Common sources on Meta:
>
> * **Meta's automatic UTMs.** Meta is reported to add its own UTMs to ads that link straight to a site, with the **ad ID in `utm_content`** and the campaign ID in `utm_campaign`. An ad ID in `utm_content` is the signature of this.
> * **Catalog and Advantage+ catalog ads.** Clicks go to the product URL in the catalog feed, not the ad's website URL.
> * **Extra destinations on the ad.** Site links, product extensions and similar Advantage+ creative options can send clicks to store URLs directly.
> * **Instagram and Facebook surfaces outside the ad.** Profile links, shop tabs, link-in-bio pages.
> * **Older or duplicated ads** whose website URL is still the store, not the ClickFlare link.

> **2. The campaign uses direct tracking**
>
> In direct tracking the ad points at Shopify, and the UTMs come from Meta's URL parameters field, not from ClickFlare. If that field (or Meta's automatic UTMs) uses `{{ad.id}}` for the UTM, Shopify shows the ID. Fix it in Meta, or switch to redirect tracking.

> **3. A different offer or path has a different URL**
>
> If the campaign rotates several offers or has several paths, one of them may use `{trackingField1}` (ad ID) where the others use `{trackingField4}` (ad name). Open every offer in the campaign and compare.

> **4. Shopify attributed the order to another visit**
>
> Shopify shows the UTMs of the session it credits, which can be a later visit than the ClickFlare one. A customer who first clicked through ClickFlare and later returned through a direct-to-store Meta link shows the later visit's UTMs. Check the conversion details for all sessions on the order.

> **5. The traffic source mapping was edited**
>
> If someone changed the Meta traffic source, `ad_name` may no longer map to `{trackingField4}`. Compare it to the table at the top of this page.

> [!NOTE]
>
> An unpopulated `{{ad.name}}` macro does not produce an ID. It produces an empty value or the literal macro text. An ID always means one of the causes above.

***

## Using another traffic source

The setup carries over to any traffic source that allows redirects: the ad points to ClickFlare, and the offer URL rebuilds the parameters for Shopify and Triple Whale. Three things change per platform.

| What changes | Where to find it |
| - | - |
| **The tracking field numbers.** Every traffic source template assigns its own fields, so the same token means different things on different platforms. | Open the traffic source in ClickFlare and read its parameter list. |
| **The platform's click ID.** `fbclid` on Meta, `ttclid` on TikTok, `ScCid` on Snapchat, `epik` on Pinterest. The template stores it as the external ID, and the offer URL passes it on with `{external_id}`. | The template's External ID row. |
| **The parameters Triple Whale requires.** Triple Whale needs its own parameters for each platform it attributes. | Triple Whale's integration article for that platform. |

> [!WARNING]
>
> Build a separate offer for each traffic source. Never reuse the Meta offer URL on another platform's campaign. On TikTok, `{trackingField1}` is the site ID and `{trackingField4}` is the campaign ID, so the Meta offer would fill the UTMs with the wrong values, without any error.

For example, the TikTok template stores the ad ID in `{trackingField8}` and the ad name in `{trackingField7}`. Built from the TikTok fields, the offer URL looks like this, followed by the Triple Whale parameters TikTok requires:

```text theme={null}
https://yourstore.com/products/your-product?utm_source=tiktok&utm_medium=paid&utm_campaign={trackingField3}&utm_term={trackingField5}&utm_content={trackingField7}&ttclid={external_id}&click_id={cf_click_id}&cpid={campaign_id}
```

> [!NOTE]
>
> Google Ads usually runs on **direct tracking**: the ad points straight at the store, and Google auto-tagging adds `gclid` itself. ClickFlare does not rewrite that URL, so the UTMs and Triple Whale parameters are set in Google Ads (in the final URL suffix or tracking template), not in the ClickFlare offer.

***

## FAQ

> **Should Triple Whale's own Meta parameters stay in the ad?**
>
> No. In this setup the ad sends ClickFlare's parameters, and ClickFlare writes `tw_source` and `tw_adid` into the store URL. If Triple Whale's parameters are also in Meta's URL parameters field, they reach ClickFlare, not Shopify, and only add noise. If you use Triple Whale's option to add its parameters to ads automatically, check the ads afterwards and keep the ClickFlare template string in place.

> **Can I send traffic straight to checkout?**
>
> You can point the offer at a cart permalink, but confirm on a test click that the parameters survive the redirect into checkout and that the Triple Whale pixel fires. A storefront page (PDP or landing page) is the safer entry point.

> **Why pass fbclid if ClickFlare already stores it?**
>
> ClickFlare stores it for its own Conversions API events. The Meta pixel and Triple Whale on Shopify can only read it from the store's URL, and the redirect removes it unless the offer URL passes it on.

> **Will ClickFlare and Triple Whale report the same revenue?**
>
> Not exactly. ClickFlare attributes the order to the tracked click. Triple Whale applies its own attribution models across all touchpoints. Use the click ID to reconcile individual orders, not to force the totals to match.

***

## Related

> **[Shopify](/docs/en/integrations/how-to-track-your-shopify-store-with-click-flare-from-product-views-to-final-sale.md)**
>
> Script and webhooks

> **[Meta cost sync](/docs/en/integrations/facebook-1.md)**
>
> Pull spend per ad

> **[Meta CAPI](/docs/en/integrations/facebook.md)**
>
> Send purchases to Meta


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