Docs menu · Our sGTM containers
Getting Started
Integrations
Server-side GTM
COD Order Protection
Advanced Features
Downloads
Tools & Support
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.
2. Server container
Variables → User-Defined Variables
| Variable | Replace this placeholder | With |
|---|---|---|
PixelFly - COD Host | https://YOUR-SGTM-DOMAIN | Your sGTM domain only, e.g.https://abcd1234.pixelfly.io |
PixelFly - COD API Key | pf_live_REPLACE_ME | Your container's API Key |
/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 tag | Fill in |
|---|---|
Facebook CAPI | Your Meta Pixel ID and CAPI access token |
GA4-Server Side | Your GA4 Measurement ID (G-…) |
Leave PixelFly COD Protection (hold) alone — it already reads the two variables above.
3. Web container
Variables → User-Defined Variables
| Variable | Replace this placeholder | With |
|---|---|---|
GA4-FM ID | G-0000000000 | Your GA4 Measurement ID |
Meta Pixel ID-000 | 0000000000 | Your Meta Pixel ID |
PixelFly - COD Protection | off | on — 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 tag | Find this field | Set it to |
|---|---|---|
Google Tag | Configuration settings → server_container_url | Your 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
| Where | What | Format |
|---|---|---|
| Variable | PixelFly - Google Ads Conversion ID | With the prefix: AW-123456789 |
| Variable | PixelFly - Google Ads Conversion Label | The label string |
| Tag | Google Ads Conversion (COD confirmed) | Un-pause it |
Web container — prepaid orders, and saving the ad click
| Where | What | Format |
|---|---|---|
| Variable | 🟣GAds-Conversion ID | Numbers only: 123456789 |
| Tag | Google Ads || AW Tag → Tag ID | With the prefix: AW-123456789 |
| Tag | Google Ads || Purchase → Conversion Label | Typed in the tag, not a variable |
| Tags | Google Ads || AW Tag and Conversion Linker | Un-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.