Docs menu · Your own sGTM containers

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

  1. Templates → Tag Templates → New → ⋮ → Import pixelfly-cod-protection.tpl → Save.
  2. 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.
  3. Its trigger (custom): Client Name equals GA4, Event Name equals purchase, Event Data cod_hold equals true. (Without a web cod_hold flag, use Event Data payment_method equals cod.)
  4. Every tag that sends a purchase (Meta CAPI, GA4, Google Ads, TikTok): add that trigger as an exception.
  5. Install the Stape Data Client (accepted path /data). Add a trigger Client Name equals Data Client, Event Name equals purchase, Event Data is_delayed equals true, and add it as a firing trigger to those same purchase tags: that’s the confirmed order coming back.
  6. Transformations: any “Exclude parameters” transformation must list the hold tag among its excluded tags, or the hold tag loses transaction_id and fails with “missing order_id”. Preview’s Event Data shows the event before Transformations.

Web container

  1. On the GA4 purchase event sent to sGTM, add parameters payment_method and cod_hold ("true" for a COD order while COD is on), and keep transaction_id, value, currency, customer user_data and gclid (from the _gcl_aw cookie: the sGTM domain can’t read your site’s cookies).
  2. 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.

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