Docs menu · Our proxy container

Docs / COD Order Protection / Set up GTM

COD Order Protection

Our ready-made proxy container

For stores without an sGTM server: one web container that holds COD orders in the browser.

Before you start

  • COD Order Protection is on in PixelFly — Step 1.
  • With no server container, the fire path is Receivers. Add one Receiver per platform a confirmed order should reach: Meta, GA4, TikTok, Google Ads.
  • Have ready: your API Key (pf_live_…), Meta Pixel ID and GA4 Measurement ID.

Allow about 10 minutes. Nothing is held until a real API Key is in place.

You edit two kinds of thing in GTM

  • Variables — left menu Variables, scroll to User-Defined Variables. Click the name, replace the placeholder, Save.
  • Tags — left menu Tags. Click the tag, fill the field inside it, Save.

Almost everything here is a Variable. Each placeholder shows its expected format — match it.

1. Import the container

Download proxy web container (.json)

In GTM: Admin → Import Container, choose the file, import. Importing into a container you already use? Use a new workspace, since Merge → Overwrite replaces values you have filled in.

2. Fill in the variables

Variables → User-Defined Variables. These three are the ones you must change:

VariableReplace this placeholderWith
PixelFly API Keypf_live_REPLACE_MEYour container's API Key
Meta Pixel ID-0000000000000Your Meta Pixel ID
GA4-FM IDG-XXXXXXXXXXYour GA4 Measurement ID

Leave these two alone unless you have your own tracking domain

VariableDefault
PixelFly - Server URLhttps://track.pixelfly.io/e
PixelFly - COD Hosthttps://track.pixelfly.io
These two are not the same value. Server URL ends in /e; COD Host has no path at all. If you swap in your own tracking domain, keep that difference — copying one over the other breaks whichever you overwrote.

3. Point GA4 purchases at PixelFly

Set the variable PixelFly - GA4 purchase via from browser to pixelfly, and add a GA4 Receiver in PixelFly.

Why it matters: a held COD order has no browser left to fire from when you confirm it days later, so on browser GA4 would only ever see prepaid orders. On pixelfly, prepaid and confirmed COD orders reach GA4, each exactly once.

Pick one route, never both. A browser GA4 purchase plus a GA4 Receiver counts every order twice.

4. Switch COD on and publish

Set the variable PixelFly - COD Protection from off to on — this is the master switch — then publish the container.

Optional: Google Ads

Skip unless you run Google Ads. These tags ship paused and cover prepaid orders.

WhereWhatFormat
Variable🟣GAds-Conversion IDNumbers only: 123456789
TagGoogle Ads || AW Tag → Tag IDWith the prefix: AW-123456789
TagGoogle Ads || Purchase → Conversion LabelTyped in the tag, not a variable
TagsGoogle Ads || AW Tag and Conversion LinkerUn-pause both

For confirmed COD orders, use either a GA4 → Google Ads import or a Google Ads (click conversions) Receiver — one, not both, or each purchase counts twice. See Google Ads and COD.

Optional: TikTok

Skip unless you run TikTok ads. Set the variable Tiktok_Pixel-000 to your TikTok Pixel ID, then un-pause the TikTok Ads Pixel tags you want. For confirmed COD orders, add a TikTok Receiver in PixelFly. They ship paused, so nothing fires until you do both.

Next

GTM is ready. Now tell your store to mark COD orders — WooCommerce plugin or custom website — then place a test order before going live.

We use cookies to enhance your experience, analyze site traffic, and for marketing purposes. By continuing to use our site, you consent to our use of cookies. Learn more