ad-landing-tracking
Capture every click id once, keep it until the sale, and send it back to the ad platform with one shared event id.
This skill covers the page and the pipe. For the event taxonomy and platform adapters, use ad-conversion-hub. For hypothesis design and budgets, use ad-experiments.
Use it when
- You build a landing page for paid traffic.
- Platform conversions are lower than your own counts.
- You add a variant page or a new platform to a working setup.
Do not use it to pick a platform or write ad copy.
Rules that never bend
- Allowlist the params you keep. Drop the rest.
- Write cookies on the first touch and on new or changed params only, after consent where the law needs it.
- Read ids at the purchase click. Do not stamp them at signup.
- Use one event id in the browser and on the server. Make it once.
- Show unknown as unknown. Never show it as zero.
- Run every spend or upload script as a dry run first.
- Launch every ad paused. A person activates it.
Workflow
- Capture. Keep click ids and UTM fields in two lists. Build one allowlist from both. Keep first touch for source reports and the latest Meta and Reddit click id for sending. Write cookies only after consent where the law needs it. Never store the raw query string. Details: identifiers-and-cookies.md.
- Carry. Put the allowlisted params on the CTA link, in storage, and into checkout metadata. Read them back in the payment webhook. Details: same file.
- Send. Make one event id once: derive it from a stable key, or create it in the browser and send it to the server. Use each platform's exact field name. Details: events-and-dedup.md.
- Vary. Serve each variant at a fixed slug. Put the arm in the UTM fields and a
variantparam. Details: variants-and-naming.md. - Read. Use one metric window for all channels. Keep the last good report. Details: reporting-and-launch.md.
- Launch. Follow the checklist below.
Launch checklist for a small test
Stop at the first item that fails.
- Fire a test event from the browser and one from the server. Use the platform's test id. Confirm both appear and merge into one event.
- Click a live ad URL. Confirm the first-touch cookie holds the UTM fields and the latest-click cookie holds the click id.
- Buy through checkout with a test card. Confirm the webhook reads the click id from the payment metadata.
- Check the spend cap. Use a lifetime or total cap where the platform has one. Otherwise set a daily budget times the days, with an end date. Also set a hard account spend limit. A daily budget alone is not a cap.
- Create the ad paused. Read back targeting, link and budget. Compare with your plan. Activate only if all match.
- Wait for the stop rule's minimum clicks. Do not read results before that.
- Read the first result on one metric window. Check unknown cells before you read the zeros.
Failure notes
| Symptom | Likely cause | Fix |
|---|---|---|
| Click id missing after a redirect | The redirect response did not set the cookie | Set the cookie on every response path |
| Events count twice in the platform | Event ids differ, or a field name has the wrong case | Use the shared id and the exact name per side |
| Fast bounces never appear in analytics | First page view fires after hydration | Send it from the inline init script |
Page shows {{token}} |
A token had no value | Replace it with a default or empty text |
| Leads vanish with no error | Login check covers the lead API | Exempt the public lead API and test as anonymous |
| Report went blank | Every row failed to measure | Keep the last good report |
What we could not find
The source review found no sample-size rule, no power analysis, no significance test and no bandit. The only stop rule is a floor on spend, conversions and return. It is not a test of significance.
For measurement design, see the measurement guide when it lands.
Unproven here: page speed budgets, cache lifetimes for ad pages, and any ranking of page structures.