Why this matters
The advanced analytics level reconciled the warehouse export, designed causal tests and governed metric definitions, assuming every destination receives the same facts. Often it does not: each ad platform arrived with its own tag and its own idea of a purchase, and the outcomes that matter happen inside software the site does not own. An expert runs collection as one system, so a gap between platforms is a difference in attribution, not in what was sent.
The tutorial on ad platform tags from one data layer builds that system around one Data LayerA structured object on a web page that passes values to a tag manager for tags to use. event per business action. The guide to tracking embedded widgets and hosted pages covers the actions your container cannot see. This exercise needs both, because every purchase at the school happens behind a hop.
The cookery school and its tags
Sulvadine Cookery School is an invented cookery school. Classes are booked in a third-party widget embedded in a frame on each class page; gift vouchers are sold on the voucher provider's own domain; private class enquiries come through a form on the school's site. There is no sign-in. The school advertises on Google Ads, Meta and Pinterest, and its consent banner has separate analytics and advertising categories.
Sulvadine Cookery School: the tags, the vendors and a closed fortnight
| Destination | How a purchase is recorded today | Consent handling |
|---|---|---|
| Analytics | The widget's settings hold the school's measurement ID, so bookings are recorded inside the frame; vouchers are not recorded | The vendor's own |
| Google Ads | A tag on clicks of any "Book now" button | Consent mode |
| Meta | The widget's own pixel field fires a purchase inside the frame; a pixel tag reads the total from the voucher return page's text; the booking platform's Meta integration sends every booking from its server with its own random identifier | None set |
| A tag an agency added on clicks of "Buy a voucher" | None set |
What the vendors document: the widget posts a completion message to the parent page with the booking reference, value and currency, and sends a notification to the school's booking system for every booking. The voucher checkout returns buyers to an address the school chooses, with the order reference, and sends an order notification for every sale, including buyers who close the tab. It also documents a field for the school's own reference on the checkout link, which it returns on the return address and in each order notification. It does not carry the school's tag.
| Closed fortnight | Class bookings | Voucher orders | Real purchases |
|---|---|---|---|
| Booking and voucher systems | 386 | 142 | 528 |
| Destination | Purchases reported | Per real purchase |
|---|---|---|
| Analytics | 274, of which 241 credited to direct | 0.52 |
| Google Ads | 1,130 | 2.14 |
| Meta | 925: 371 from the widget's pixel, 386 from the server, 168 from voucher page views | 1.75 |
| 409 | 0.77 |
One contract, many platforms, one hop
Two rules do most of the work. The site describes each action once, when it is true, and the container translates it for each platform through a written mapping. An outcome inside someone else's software is recorded where you control the code, its source travels with the person, and a system confirms what the browser never sees. One identifier on both routes makes DeduplicationRemoving double counts when one conversion is reported by more than one source. possible. The User-ID guide gives a site without sign-in nothing to send, so the booking or order reference is the key here.
Task
- Write the event contract: the business events, when each push fires, and the fields every destination needs, including an event identifier and where its value comes from.
- Build the mapping table: set each business event against analytics, Google Ads, Meta and Pinterest, with the event name and fields each destination takes.
- Decide how widget bookings and voucher sales are recorded, which signal is the record of each, and how purchases the browser never sees are confirmed.
- Say how the source is kept across each hop, and whether cross-domain measurementConfiguring analytics so a visit that moves between a business's own domains stays one session. applies.
- Set the consent checks for every tag, for the widget and for the server sends.
- Write the tests before publishing, the checks for the first week, and what is removed in the same release.
Worked answer
The contract. Two business events cover what the platforms optimise towards. purchase fires once when a
booking or voucher order is confirmed, with value, currency, transaction identifier, items, a provider parameter
and an event_id; enquiry fires when the server accepts a private class enquiry. Each identifier is created
once with the action and stored with it: the booking reference and the voucher order reference, each with its own
prefix so the two systems never collide, and the enquiry record's identifier. Customer details stay out of the
shared push.
The mapping. Shared variables and one trigger per business event serve every tag. Where a cell describes an event rather than naming it, the tracking plan holds the name from that platform's own help pages and notes where it came from.
| Business event | Analytics | Google Ads | Meta | |
|---|---|---|---|---|
purchase | The same event name, reading items, transaction ID, value, currency and the provider parameter | Conversion action "Class or voucher purchase", its label looked up from the business event; transaction ID, value and currency from the shared variables | Purchase, carrying the event ID alongside contents, value and currency | Pinterest's checkout event, named as its own help pages give it and noted in the tracking plan |
enquiry | GA4's recommended lead event and its lead type parameter | Conversion action "Private class enquiry" | Meta's lead standard event, with the event ID | Not mapped: the school does not optimise towards enquiries there |
The widget. The in-frame measurement ID and pixel field go: they measured the frame as its own visit, which
is why bookings landed on direct. A listener accepts the vendor's documented completion message only from the
vendor's domain and pushes purchase; the visit never leaves the school's page, so the source is kept. The booking
system is the record: bookings whose message never arrived are sent from it with the same reference.
The voucher checkout. It carries no school tag, so cross-domain measurement has nothing to read there. The
provider becomes an unwanted referral, and its return address points to a confirmation page that pushes purchase
once per order reference, guarded against reloads. Before the buyer leaves, the school's code stores the landing
source against its own reference and puts that reference in the checkout link's documented field; the provider
returns it with each order, so purchases sent from order notifications carry their source too.
Server sends. The booking platform's Meta integration sends the prefixed reference as the event ID, with the same event name and promptly; voucher notifications use the same route. Pinterest stays browser-only: nothing in the plan assumes a server route for it. Google Ads reads the same transaction ID from the push, as the mapping table specifies, so one reference identifies each order in every destination.
Consent. Google's tags carry Consent ModeA Google tag feature that adjusts what tags collect according to the visitor's consent choices. checks; every Meta and Pinterest tag requires advertising consent in its consent settings, one pattern for the container. The vendor's own cookies in the frame are a decision for whoever owns privacy. The consent state is stored with the reference, and server sends forward only what it allows.
Tests and release. In preview, a test booking, voucher and enquiry each fire every mapped tag once with the same values and identifiers; a reload adds nothing, a message from another origin is ignored, and with consent refused nothing reaches Meta or Pinterest. Each platform's testing tools confirm receipt, and Meta's also confirm that browser and server copies are deduplicated. The old tags go in the same release, run through the container publish checklist, and each day of the first week every platform's count is compared with the booking and voucher systems.
Sulvadine Cookery School: the first closed fortnight after the release
The booking and voucher systems recorded 402 class bookings and 151 voucher orders: 553 real purchases.
| Destination | Purchases reported | Per real purchase |
|---|---|---|
| Analytics | 489: 352 from the widget message, 117 from the voucher confirmation page, 20 sent from the systems | 0.88 |
| Google Ads | 520 | 0.94 |
| Meta | 566, browser and server copies deduplicated | 1.02 |
| 461 | 0.83 |
The share of analytics purchases credited to direct fell from 88% to 10%. No platform matches the booking and voucher systems exactly; refused consent, blockers and each platform's own attribution rules account for the remaining gaps, so the school now reads them as attribution rather than as faults in its tags.
Common mistakes
- Leaving the booking platform's Meta integration on its own identifier. The listener's pixel event and the server copy then describe one booking with two values, and Meta keeps both.
- One number range for bookings and voucher orders. Without a prefix a class booking and a voucher order can share a reference, and a destination that deduplicates on it can discard a real sale as a copy.
- A voucher confirmation page with no reload guard. A buyer who refreshes it, or opens it again from the browser history, records the same order a second time.
- Sending system-confirmed bookings without the stored consent state. The server never saw the banner, so a booking the widget message missed reaches Meta even when the visitor declined advertising.
- Judging the platforms against the widget's own totals. The booking and voucher systems are the record; the widget's report is a partial view and contains no vouchers at all.
The checkpoint on data layer contracts, embedded tools and User-ID tests these judgements and adds the signed-in case.
