Docs menu · Our sGTM containers

Docs / COD Order Protection / Set up GTM

COD Order Protection

Our ready-made sGTM containers

The fastest setup for stores with a PixelFly sGTM server: import two containers and replace a handful of placeholder values.

Before you start

  • COD Order Protection is on in PixelFly, with a fire path chosen — Step 1.
  • Have ready: your API Key (pf_live_…), your Hold URL, your Meta Pixel ID and CAPI access token, and your GA4 Measurement ID.

Allow about 15 minutes. Nothing is held until the host and API key are both real, so a half-finished setup never loses orders.

You edit two kinds of thing in GTM

Knowing which is which saves most of the confusion:

  • Variables — left menu Variables, scroll to User-Defined Variables. Click the name, replace the placeholder text, Save. One value, used by many tags.
  • Tags — left menu Tags. Click the tag, fill the field inside it, Save.

Everything below says which of the two you are opening. Each placeholder also shows you its expected format — match it.

1. Import the two containers

In each GTM container: Admin → Import Container, choose the file, import.

Already using these containers? Import into a new workspace and copy your own IDs across afterwards. Merge → Overwrite replaces values you have already filled in.

2. Server container

Variables → User-Defined Variables

VariableReplace this placeholderWith
PixelFly - COD Hosthttps://YOUR-SGTM-DOMAINYour sGTM domain only, e.g.
https://abcd1234.pixelfly.io
PixelFly - COD API Keypf_live_REPLACE_MEYour container's API Key
COD Host is the domain only. Your Hold URL ends in /cod/hold — do not paste that part. The tag adds the path itself, and leaving it on is the single most common mistake here.

Tags

Open this tagFill in
Facebook CAPIYour Meta Pixel ID and CAPI access token
GA4-Server SideYour GA4 Measurement ID (G-…)

Leave PixelFly COD Protection (hold) alone — it already reads the two variables above.

3. Web container

Variables → User-Defined Variables

VariableReplace this placeholderWith
GA4-FM IDG-0000000000Your GA4 Measurement ID
Meta Pixel ID-0000000000000Your Meta Pixel ID
PixelFly - COD Protectionoffon — this is the master switch

GA4-FM ID is used by every GA4 tag and by the Google Tag, so GA4 does not work at all until you set it.

Tags

Open this tagFind this fieldSet it to
Google TagConfiguration settings → server_container_urlYour sGTM domain

This one is inside the tag, not a variable — it ships as 0000000000000, which is easy to scroll past.

4. Publish, server container first

Publish the server container, then the web one. In that order the server is ready to receive the first held order the moment the web container starts sending them.

Optional: Google Ads

Skip unless you run Google Ads. Every Google Ads tag ships paused, so nothing happens until you fill the values and un-pause the tags. Note that the two containers want the conversion ID in different formats — follow each placeholder.

Server container — sends the confirmed COD order

WhereWhatFormat
VariablePixelFly - Google Ads Conversion IDWith the prefix: AW-123456789
VariablePixelFly - Google Ads Conversion LabelThe label string
TagGoogle Ads Conversion (COD confirmed)Un-pause it

Web container — prepaid orders, and saving the ad click

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

The AW Tag and Conversion Linker are what save the ad click (gclid) at checkout. Without them, Google Ads has nothing to credit the confirmed COD order to when it arrives days later. More detail: 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. In the server container, also fill in the TikTok Events API tag and un-pause it, so confirmed COD orders reach TikTok too. 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