Don't have one? Create one ↗
← All courses

Lesson 11 of 16

Refunds

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

Revenue is only half the story, GA4 also wants the money that goes back out. The refund event mirrors purchase: it carries the same transaction_id so GA4 can match the refund to the original order and net it out of your reports.

A full refund just names the order and its value. A partial refund adds an items array listing exactly what came back. Both push the same event name, so one trigger and tag handle both.

Goal

Fire a GA4 refund tag on the refund event, reading the ecommerce object for full and partial refunds.

Build it in GTM

  1. Know what the page pushes

    Both buttons push { event: "refund", ecommerce: { transaction_id, currency, value, ... } }. The full refund omits items; the partial refund includes the returned items. GTM sees an event named refund either way.
  2. Create the Custom Event trigger

    Triggers → New → Custom Event, event name refund. It must match the pushed string exactly, so one trigger covers both full and partial refunds.
  3. Fire a GA4 refund tag on it

    Build a GA4 Event tag named refund that reads the ecommerce object (map transaction_id, value and the items array when present), and set the trigger above as its firing trigger. The course's Custom HTML - Test stand-in with <script></script> is an accepted placeholder.

Debug in Tag Assistant

Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

Issue a refund. In Tag Assistant a refund event appears in the left rail, and your GA4 refund tag shows under Tags Fired carrying the same transaction_id as the original order.

Verify your container

Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.

Drop your container .json here

or browse · checked in your browser, nothing is uploaded

0 of 16 lessons complete