Digital Marketing · Focus area 2: Tracking, analytics and testing
DM5: Tracking: events, tags and measurement plans
Goal: explain how page tags and pixels collect data, design events and parameters in the style of Google Analytics 4, write a measurement plan from business questions, tag campaign links consistently, and test that tracking sends exactly what the plan says.
You'll need: DM4, Module 17 (JavaScript Basics), Module 19 (Browser Interactions), Module 21 (Arrays and Objects), Module 25 (APIs
and JSON), and the MittiMart practice kit (site/js/tags.js, site/js/shop.js, tracking/).
Where this is used: every decision in DM6 and DM7 (which page loses people, which campaign pays, whether a test won) is only as good as the tracking behind it. Broken or doubled events are common, and they lead teams to confident wrong answers.
How it differs: an engineer's logs record what the system did. Marketing tracking records what people did, in a shape analysts can count, with consent and without personal data. The skill is designing events that answer questions, not collecting everything.
Time: reading about 2½ hours · practice (the Try it tasks) about 3 hours · assignment about 3½ hours.
Lessons
- 1How tracking worksReading 15–25 minutes, plus practice✓
- 2Events and parameters, the GA4 wayReading 15–25 minutes, plus practice✓
- 3Measurement plansReading 15–25 minutes, plus practice✓
- 4Campaign tags (UTM parameters)Reading 15–25 minutes, plus practice✓
- 5Testing tracking before you trust itReading 15–25 minutes, plus practice✓
🛠️Assignment: Make MittiMart's tracking match its plan
- Write MittiMart's three business questions and map each to metrics and events.
- Write
tracking/event-plan.mdin the format intracking/README.md. - Fix
site/js/shop.js: numbers in rupees,begin_checkout, a cleanpurchasesent once per order, andgenerate_leadwithout the email. - Add campaign tags to page views for the whole visit in
site/js/tags.js. - Run the tracking tests twice and keep the output.
Self-check before you finish:
- [ ] Every event in the plan is sent in the test journey, and nothing else is.
- [ ]
valueis a number in rupees in every shop event. - [ ] Reloading the thank-you page doesn't send another purchase.
- [ ]
npm run test:trackingpasses 10 of 10, twice in a row.
✅Module check
Explain in a few sentences, in your own words:
How do you build tracking a team can trust?
Show a good answer
A good answer mentions: tags sending events with parameters to a collection endpoint; client IDs as personal data stored only after
consent; first-party measurement and what tracking can't see; recommended event names such as view_item, add_to_cart,
begin_checkout and purchase with currency, numeric value and items; key events; a measurement plan that starts from business
questions and lists each event's trigger, parameters, units and consent; consistent UTM tags kept for the visit and not used on internal
links; and testing with captured requests and a QA checklist: consent, once per action, types, no personal data, no doubled purchases.
📚Official references
Official documentation and guidance for this module's topics, chosen on 2 November 2026. Tools, laws and standards change, so check the current version before you rely on a detail. If a link has moved, search the same site.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
