Skip to main content
Adobe Commerce and ClickFlare Integration Adobe Commerce, formerly Magento, is an e-commerce platform you host yourself or on Adobe’s cloud. Your catalog, cart, checkout and checkout success page run on it, and each store view has its own design settings. ClickFlare tracks the ad click. This guide connects the two so every order is attributed to the campaign, traffic source and ad that brought the buyer. Data moves from the store to ClickFlare:
  • The ClickFlare script goes in the store view’s HTML Head, so every page records the visit and keeps the click ID in the browser.
  • A conversion script on the checkout success page reports the order to ClickFlare with the order number and total.
Unlike hosted platforms, Adobe Commerce has no admin field that fills order data into a script. Putting the order number and total into the conversion script takes a small change to the success page template, made by whoever maintains your theme. The steps below say exactly what that change needs to do.
Server-side reporting is more reliable than a browser script, because ad blockers and cookie limits can’t stop it. Adobe Commerce can send webhooks with fields you name yourself, but only a developer can set that up, and the click ID has to be saved on the order first. See Server-side option.

At a glance

To set up Adobe Commerce with ClickFlare:
  1. Set up a tracking domain and campaign.
  2. Create the store as an offer.
  3. Add the script to the HTML Head.
  4. Allow your tracking domain in CSP.
  5. Add the conversion to the success page.
Each step is explained in Setup.

How the data flows


What you’ll need

  • A ClickFlare account with your own tracking domain. Shared domains get flagged by ad platforms and blocked by browsers. See Tracking domains.
  • Adobe Commerce Admin access to Content → Design → Configuration.
  • Someone who can edit the theme’s checkout success page and your Content Security Policy.
The Admin steps come from Adobe’s guide for Adobe Commerce on cloud infrastructure and on-premises. On Adobe Commerce as a Cloud Service, or on Magento Open Source, check that the same settings are there before you start.

Setup

1

Set up your own tracking domain

Add a custom tracking domain such as trk.yourdomain.com before anything else. Both scripts load from it, and the conversion script only finds the click ID when they use the same domain as the campaign. See Tracking domains.
2

Create the custom conversion (optional)

Go to Settings → Custom Conversions, click Add and create Sale with the parameter sale, Include in Conversions and Include in Revenue turned on. The value in ct must match it exactly. See Custom conversions.
3

Create the campaign

Go to Campaigns → New Campaign, pick your traffic source and tracking domain, and choose Redirect (if the source allows redirects) or Direct (Google Ads and other sources that don’t). Create one campaign per traffic source. See Creating a campaign.
4

Create the store as an offer

In the campaign path, create the offer inline with your store or product page URL and the ClickFlare tokens:
For a direct campaign, turn on the Direct Tracking switch in the offer. Save the campaign and copy the tracking script from its Tracking tab.
Keep the braces: {cf_click_id}. Without them the store receives the literal text cf_click_id.
5

Add the script to the HTML Head

In the Admin, go to Content → Design → Configuration. Find the store view and click Edit. Under Other Settings, expand HTML Head and paste the script in Scripts and Style Sheets:
Click Save Configuration. The setting is per store view, so repeat it for every store view that gets ClickFlare traffic. You can use the Miscellaneous HTML field in the Footer section instead if you prefer the script before the closing body tag. See Direct tracking.
6

Allow your tracking domain in CSP

Adobe Commerce doesn’t run JavaScript from the Scripts and Style Sheets or Miscellaneous HTML fields on the checkout pages unless it is allowlisted in the Content Security Policy settings. Add your ClickFlare tracking domain, for example trk.yourdomain.com, to the CSP allowlist. Do this before the next step: the success page is part of checkout, so a conversion script loaded from a domain that isn’t allowlisted can be blocked there too.
7

Add the conversion script to the success page

In ClickFlare, go to Settings → Tracking URLs and copy the JavaScript conversion script. It reads the click ID from the visitor’s browser. Remove the click_id=OPTIONAL placeholder. See Conversion tracking pixel.Hand the script to your developer with this brief: on the checkout success page only, output the script with the order’s values in the URL:
  • payout: the order total, as a plain number with no currency sign.
  • txid: the order number the customer sees. It keeps a reload of the success page from counting twice.
  • ct=sale: leave it out if you skipped the custom conversion.
The script must load from your tracking domain, so it needs the same CSP allowlisting as the head script.

Why the transaction ID matters

ClickFlare keeps one conversion per click ID unless the transaction ID differs. With the order number as txid:
  • A buyer who reloads the success page sends the same order number, and ClickFlare doesn’t count it twice.
  • A second order from the same click has a new number and counts as its own conversion.
Without txid, the second order replaces the first.

Server-side option

Adobe Commerce webhooks call an external URL when something happens in the store, and you choose which fields to send and what to name them. On cloud and on-premises installs a developer defines them in webhooks.xml; on Adobe Commerce as a Cloud Service they are under System → Webhooks in the Admin. Because field names are yours to set, a webhook could post JSON straight to ClickFlare with the keys cf_click_id, payout and ct, with no Zapier or Make in between. Two things make this a developer project:
  • The click ID isn’t on the order. Adobe Commerce has no Admin setting that saves URL parameters with orders. Your developer has to save the click ID during the visit and copy it onto the quote or order so the webhook can send it.
  • Webhooks run in real time and can stop the store operation that triggered them if they fail. Have your developer make sure a failed call to ClickFlare never blocks an order.
The benefit is reliability: the order reaches ClickFlare even when the buyer’s browser blocks scripts or never loads the success page.

Verify the setup

1

Click through the campaign

Open the ClickFlare campaign URL in a private window. The store URL should show click_id= followed by a long ID.
2

Check the scripts load

In your browser’s network tab, look for the request to /cf/scripts/ on your tracking domain. On the checkout, check the console for CSP errors that name your tracking domain.
3

Place a test order

On the success page, look for the request to /cf/cv with a real total and order number.
4

Check ClickFlare

The order should appear on the campaign with its revenue. In Logs → Event Logs, check that txid is the order number.

Troubleshooting

The tracking domain isn’t allowlisted in your Content Security Policy. Add it and test again.
The HTML Head setting is per store view. Add the script to each store view that gets traffic.
The conversion script found no click ID. Check that the tracking script loads on the landing page, that both scripts use the same tracking domain as the campaign, and that the offer URL has click_id={cf_click_id} with braces.
The success page script sends payout empty or with a currency sign. It must be a plain number. See Troubleshooting S2S postbacks for the general checks.

FAQ

Yes. The ClickFlare script runs in the store view’s HTML Head, and a conversion script on the checkout success page reports each order with its total and order number.
You can paste it in Scripts and Style Sheets, but that field runs on every page and has no order values, so it would report a conversion on every page view. The success page needs a template change.
Yes. Use a direct campaign. The ad links straight to the store and the script records the visit without a redirect.
No. The success page only reports new orders. Adjust refunds in ClickFlare, or include them in a server-side setup.
Yes. Once ClickFlare records the order, it can pass it to the traffic source through that source’s postback or conversion API integration.

Direct tracking

How the on-page script works

Conversion pixel

Get the conversion script

WooCommerce

Another self-hosted store