Docs menu · Your own 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
Your own sGTM containers
Add COD Order Protection to web and server containers you already run.
First turn COD Order Protection on in PixelFly: Step 1.
Server container
- Templates → Tag Templates → New → ⋮ → Import pixelfly-cod-protection.tpl → Save.
- New tag PixelFly COD Protection (hold): Server hostname = the Hold URL host, API Key = your container’s API Key, How to read order fields = Auto, Skip if not COD = on.
- Its trigger (custom): Client Name equals
GA4, Event Name equalspurchase, Event Datacod_holdequalstrue. (Without a webcod_holdflag, use Event Datapayment_methodequalscod.) - Every tag that sends a purchase (Meta CAPI, GA4, Google Ads, TikTok): add that trigger as an exception.
- Install the Stape Data Client (accepted path
/data). Add a trigger Client Name equalsData Client, Event Name equalspurchase, Event Datais_delayedequalstrue, and add it as a firing trigger to those same purchase tags: that’s the confirmed order coming back. - Transformations: any “Exclude parameters” transformation must list the hold tag among its excluded tags, or the hold tag loses
transaction_idand fails with “missing order_id”. Preview’s Event Data shows the event before Transformations.
Web container
- On the GA4 purchase event sent to sGTM, add parameters
payment_methodandcod_hold("true"for a COD order while COD is on), and keeptransaction_id,value,currency, customeruser_dataandgclid(from the_gcl_awcookie: the sGTM domain can’t read your site’s cookies). - Browser purchase tags (Meta Pixel, Google Ads, TikTok): add an exception trigger “purchase where cod_hold is true”.
Our web and server containers show every one of these pieces; import them into a spare workspace to copy from.