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

  1. 1How tracking worksReading 15–25 minutes, plus practice✓
  2. 2Events and parameters, the GA4 wayReading 15–25 minutes, plus practice✓
  3. 3Measurement plansReading 15–25 minutes, plus practice✓
  4. 4Campaign tags (UTM parameters)Reading 15–25 minutes, plus practice✓
  5. 5Testing tracking before you trust itReading 15–25 minutes, plus practice✓

🛠️Assignment: Make MittiMart's tracking match its plan

  1. Write MittiMart's three business questions and map each to metrics and events.
  2. Write tracking/event-plan.md in the format in tracking/README.md.
  3. Fix site/js/shop.js: numbers in rupees, begin_checkout, a clean purchase sent once per order, and generate_lead without the email.
  4. Add campaign tags to page views for the whole visit in site/js/tags.js.
  5. Run the tracking tests twice and keep the output.

Self-check before you finish:

✅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 ·

1. A product page's tag sends an event whenever the page loads. Which part links that event to other visits from the same browser?

Why each option is right or wrong

  • “The event name, such as view_item, sent with every page load” (Incorrect): The name says what happened, not who.
  • “The items list, which names the product the visitor looked at” (Incorrect): It describes the product, not the visitor.
  • “The page title, which is the same on every visit to that page” (Incorrect): Every visitor sees the same title.
  • “The client ID stored in the browser and sent with each event” is correct.

    A random ID in a cookie or local storage links events from the same browser.

    • Created: only after consent.
    • Status: personal data when linked to behaviour.

📖 Revise: Lesson 1: How tracking works

Question ID sp-digital-marketing-05-q1 · Report a mistake in this question
2. A shop's analytics shows 40% fewer orders than its payment records. What's the most likely explanation?

Why each option is right or wrong

  • “The payment records are wrong, since analytics measures every order directly” (Incorrect): Analytics is a sample; payment records are the system of record.
  • “Customers are placing orders that are too small for analytics to record” (Incorrect): Order size doesn't affect whether an event is sent.
  • “Analytics tools only count orders placed on desktop computers” (Incorrect): Phones are tracked too.
  • “Tracking misses orders: no consent, blockers, or buyers who didn't return to the page” is correct.

    Analytics can't see every visit, so purchase counts fall short of real orders.

    • Do: reconcile with orders.
    • Use: analytics for patterns, orders for totals.

📖 Revise: Lesson 1: How tracking works

Question ID sp-digital-marketing-05-q2 · Report a mistake in this question
3. Which add_to_cart event is right for 3 diya packs at ₹240 each?

Why each option is right or wrong

  • “{"value": "₹720", "currency": "INR", "items": [...]}” (Incorrect): A text value can't be summed in reports.
  • “{"value": 72000, "currency": "INR", "items": [...]} in paise” (Incorrect): The plan says rupees; 72,000 would be read as ₹72,000.
  • “{"value": 240, "currency": "INR", "items": [{"item_id": "diya-pack"}]}” (Incorrect): Value should be price × quantity, and quantity is missing.
  • “{"value": 720, "currency": "INR", "items": [{"item_id": "diya-pack", "quantity": 3}]}” is correct.

    A number in rupees, the currency and the items with quantity.

    • Plus: item_name and price in the item.
    • Kit: test 5 checks these.

📖 Revise: Lesson 2: Events and parameters, the GA4 way

Question ID sp-digital-marketing-05-q3 · Report a mistake in this question
4. One team sends addToCart, another cart_add, and the plan says add_to_cart. What's the best fix?

Why each option is right or wrong

  • “Keep all three names, and add them together in every report by hand each month” (Incorrect): Manual merging is error-prone and breaks standard reports.
  • “Rename all three to ADD_TO_CART_EVENT so that the name stands out” (Incorrect): A new name doesn't match the recommended one either.
  • “Delete the event, as adding to cart isn't an important step” (Incorrect): It's a key funnel step.
  • “Use the recommended add_to_cart everywhere, as written in the plan” is correct.

    One documented name makes reports add up.

    • Check: test against the plan.
    • Fix: in one change.

📖 Revise: Lesson 2: Events and parameters, the GA4 way

Question ID sp-digital-marketing-05-q4 · Report a mistake in this question
5. What should a measurement plan start from?

Why each option is right or wrong

  • “A list of every click and scroll on every page” (Incorrect): Collecting everything adds cost without answering questions.
  • “The default events the analytics tool sends on its own” (Incorrect): Defaults rarely match the business's questions.
  • “Whatever the previous agency set up, copied exactly as it is” (Incorrect): Old setups may answer questions nobody asks now.
  • “The business questions the data must answer” is correct.

    Questions decide the metrics, and metrics decide the events.

    • Chain: question → metric → event → parameters → consent.
    • Fewer: only events a question needs.

📖 Revise: Lesson 3: Measurement plans

Question ID sp-digital-marketing-05-q5 · Report a mistake in this question
6. A plan lists begin_checkout, but the site stopped sending it months ago. What would have caught this?

Why each option is right or wrong

  • “A longer plan that describes each event in more detail” (Incorrect): Detail doesn't check what the site sends.
  • “Sending a reminder email to developers about the plan every quarter” (Incorrect): Reminders don't verify behaviour.
  • “Deleting the plan, since plans tend to go out of date” (Incorrect): Without a plan nobody knows what should be sent.
  • “An automated test that compares sent events with the plan” is correct.

    A test fails as soon as the site and the plan disagree.

    • Kit: Project 1 test 10.
    • Habit: plan and code change together.

📖 Revise: Lesson 3: Measurement plans

Question ID sp-digital-marketing-05-q6 · Report a mistake in this question
7. Which tagged link is best for MittiMart's Diwali newsletter?

Why each option is right or wrong

  • “?utm_source=Newsletter&utm_medium=E-mail&utm_campaign=Diwali Offer” (Incorrect): Capitals and spaces create inconsistent values.
  • “?utm_source=asha.rao@example.com&utm_campaign=diwali” (Incorrect): Personal data must not go in campaign tags.
  • “?campaign=diwali” (Incorrect): Tools don't read a custom parameter as a campaign tag.
  • “?utm_source=newsletter&utm_medium=email&utm_campaign=diwali-2026” is correct.

    Lower case, consistent medium, and a clear campaign name.

    • Rule: a fixed list of values.
    • Tool: a shared link builder.

📖 Revise: Lesson 4: Campaign tags (UTM parameters)

Question ID sp-digital-marketing-05-q7 · Report a mistake in this question
8. A shop adds UTM tags to the links in its own top menu. What happens?

Why each option is right or wrong

  • “Nothing changes, because tools ignore tags on internal links” (Incorrect): Tools read them and start a new campaign.
  • “Reports get more accurate, as every click is now labelled” (Incorrect): It mislabels visits that came from elsewhere.
  • “The menu links stop working until the tags are removed again” (Incorrect): The links still work; the data is wrong.
  • “Visits restart in the middle, so purchases are credited to the menu” is correct.

    Internal tags overwrite the real source, breaking attribution.

    • Fix: tag only links from outside.
    • Internal: use events instead.

📖 Revise: Lesson 4: Campaign tags (UTM parameters)

Question ID sp-digital-marketing-05-q8 · Report a mistake in this question
9. After a release, a shop's conversion rate doubles overnight. What should the analyst check first?

Why each option is right or wrong

  • “Which advert or campaign caused the sudden increase in sales” (Incorrect): A doubling overnight is more likely a tracking change.
  • “Whether the new design should be rolled out to other countries” (Incorrect): Decisions should wait until the data is checked.
  • “Whether the analytics tool's servers had an outage on that day” (Incorrect): An outage would lower numbers, not double them.
  • “Whether purchase now fires twice, by comparing with the order database” is correct.

    Sudden jumps after releases usually come from tracking changes.

    • Guard: transaction_id.
    • Test: reloads and back buttons.

📖 Revise: Lesson 5: Testing tracking before you trust it

Question ID sp-digital-marketing-05-q9 · Report a mistake in this question
10. Which belongs on a tracking QA checklist before release?

Why each option is right or wrong

  • “Making sure every page sends at least ten different events, so nothing is missed” (Incorrect): The number of events isn't a quality measure.
  • “Confirming the tag manager's colour theme matches the brand” (Incorrect): Irrelevant to data quality.
  • “Checking that the analytics bill hasn't gone up this month” (Incorrect): Cost isn't a tracking check.
  • “Nothing sent before consent, each event once, numbers typed, no personal data” is correct.

    These are the checks that make data trustworthy and lawful.

    • Also: no doubled purchases; campaigns kept.
    • Automate: in tests.

📖 Revise: Lesson 5: Testing tracking before you trust it

Question ID sp-digital-marketing-05-q10 · Report a mistake in this question

ProLearners Assist