Digital Marketing (Growth and Analytics) · entry diagnostic

Digital Marketing (Growth and Analytics): entry diagnostic

Ten questions on the core lessons this path builds on. It is for your own planning: it doesn't unlock anything, and it doesn't replace the final examination. Each explanation links to the core module to revisit if you got it wrong.

10 questions · for your own planning · it does not unlock anything and does not replace the final examination ·

1. A shop's product page has the heading "Clay water bottle" in a <div class="big"> and three more <h1> elements lower down for

Why each option is right or wrong

  • “Keep the div for the product name and turn the other three into <h1> styled smaller” (Incorrect): The product name is the page's main heading, so it belongs in the one h1.
  • “Make every heading a div with bold text, so the page looks the same on every browser” (Incorrect): Styled divs look like headings but aren't treated as headings by browsers or search engines.
  • “Four <h1> elements, as each section is equally important to a shopper” (Incorrect): Several h1s blur what the page is about; sections use h2.
  • “One <h1> for the product name, and <h2> for Reviews, Delivery and Care” is correct.

    One main heading, then sections in order, gives people and search engines a clear outline.

    • Later: one h1 per page (DM2, kit test 2).
    • Also: headings help screen reader users jump between sections.

📖 Revise: Module 12: Webpage Content

2. A newsletter form is written as <form action="/subscribe" method="get"> with one email field. What happens when someone signs up?

Why each option is right or wrong

  • “Nothing unusual, as GET and POST send form data in the same way” (Incorrect): They differ: GET puts the fields in the address, POST sends them in the request body.
  • “The browser encrypts the email so that only the server can read it” (Incorrect): The method doesn't encrypt anything; HTTPS protects data in transit, but the address is still logged and shared.
  • “The form can't be submitted, as GET is only for links and not for forms” (Incorrect): Forms can use GET; it suits searches, not personal details.
  • “The email appears in the address, e.g. /subscribe?email=asha%40example.com” is correct.

    GET adds the fields to the address, where history, server logs and analytics tags can pick them up.

    • Fix: method="post" for personal details.
    • Later: keeping personal data out of analytics (DM4, DM5).

📖 Revise: Module 13: Forms and Inputs

3. A product image is 1,200 pixels wide and the layout breaks on a phone 360 pixels wide. Which CSS fixes it most simply?

Why each option is right or wrong

  • “img { width: 1200px; }, so that every image has the same fixed width” (Incorrect): A fixed width wider than the screen makes the page scroll sideways.
  • “Hide every image on screens narrower than 600 pixels using a media query” (Incorrect): Hiding product images on phones removes what most shoppers came to see.
  • “body { overflow: hidden; }, so the extra width can't be seen at all” (Incorrect): That hides part of the image instead of fitting it, and can hide other content too.
  • “img { max-width: 100%; height: auto; } so it shrinks to fit on a phone” is correct.

    The image shrinks to fit its container and keeps its shape.

    • Also: width and height attributes, so the page doesn't jump (DM3).
    • Check: test at 320 pixels wide.

📖 Revise: Module 16: Responsive Websites

4. A price is stored as the text "₹480" and a script adds two of them with price + price. What does it produce?

Why each option is right or wrong

  • “960, as JavaScript reads the rupee sign and converts the text to a number” (Incorrect): JavaScript doesn't convert text with a currency sign into a number.
  • “An error, so the script stops before adding the two prices together” (Incorrect): Adding two strings is allowed; it just joins them.
  • “NaN, the value JavaScript gives when a sum doesn't make sense” (Incorrect): NaN comes from arithmetic such as subtraction on text, not from +.
  • “"₹480₹480", because + joins two pieces of text instead of adding” is correct.

    With text, + joins; store prices as numbers, such as 480, and add the sign only when showing them.

    • Later: analytics values as numbers (DM5, kit test 5).

📖 Revise: Module 17: JavaScript Basics

5. A script on every page runs document.querySelector('#add').addEventListener('click', addToCart). On the home page, which has no

Why each option is right or wrong

  • “The click event only works on product pages, so the browser refuses it elsewhere” (Incorrect): The event works anywhere; the problem is the missing element.
  • “addToCart must be written before the script in the HTML for it to work” (Incorrect): Order of definition matters for some code, but this error is about null.
  • “The # in #add isn't allowed, so the selector should be 'add' instead” (Incorrect): #add is the right selector for an element with id="add".
  • “querySelector returns null, and null has no addEventListener” is correct.

    When nothing matches, there's no element to attach to; check for it first.

    • Fix: const b = document.querySelector('#add'); if (b) b.addEventListener(...).
    • Later: shop scripts that run on every page (DM5).

📖 Revise: Module 19: Browser Interactions

6. An order is stored as { items: [{ id: 'kulhad-set', qty: 2, price: 480 }, { id: 'diya-pack', qty: 1, price: 240 }] }. Which code

Why each option is right or wrong

  • “order.items.length * order.items[0].price, two items at the first price” (Incorrect): That counts lines, not quantities, and uses one price for both: 960.
  • “order.items.qty * order.items.price, which multiplies the two lists” (Incorrect): items is a list; qty and price belong to each item, so this gives NaN.
  • “order.items[0].price + order.items[1].price, adding the two prices” (Incorrect): That ignores the quantity of 2 kulhad sets and gives 720.
  • “order.items.reduce((sum, i) => sum + i.qty * i.price, 0), line by line” is correct.

    It multiplies each item's quantity by its price and adds them, giving 1,200.

    • Later: cart values for begin_checkout and purchase (DM5).

📖 Revise: Module 21: Arrays and Objects

7. A report counts 735 orders from 694 different visitors. Which loop counts the visitors who bought at least once?

Why each option is right or wrong

  • “Add 1 to a counter for every order in the list, then report the counter” (Incorrect): That counts orders (735), not visitors.
  • “Count the orders and divide by 2, as some visitors ordered twice” (Incorrect): Only some visitors ordered twice, so halving gives the wrong answer.
  • “Count the orders with an order value above zero, which removes the repeats” (Incorrect): Every order has a value, so nothing is removed.
  • “Add each order's visitor ID to a Set, then read the set's size” is correct.

    A set keeps each value once, so its size is the number of different visitors: 694.

    • Later: conversion counted per visitor, not per order (DM6, DM7).

📖 Revise: Module 22: Loops and Algorithms

8. A page sends an analytics event with fetch('/collect', …) and then immediately moves to the thank-you page. The event sometimes

Why each option is right or wrong

  • “fetch only works on the page it was written on, so the next page cancels it every time” (Incorrect): Leaving the page can cancel a request that hasn't finished; it doesn't do so every time.
  • “Analytics servers ignore events sent during navigation, as a rule built into browsers” (Incorrect): There's no such rule; the issue is timing.
  • “fetch needs await before it will send anything, even if the page stays open” (Incorrect): A fetch without await still sends; await only waits for the reply.
  • “fetch is asynchronous, and leaving the page can cancel the request before it ends” is correct.

    The request starts but may not finish before the page changes.

    • Fix: wait for it, or use keepalive: true or navigator.sendBeacon.
    • Later: testing that tracking really sends (DM5).

📖 Revise: Module 24: Asynchronous Programming

9. A marketing tool sends {"event":"purchase","value":"1200","currency":"INR"}. What's wrong with the value?

Why each option is right or wrong

  • “Nothing, as JSON doesn't tell the difference between text and numbers” (Incorrect): JSON does: "1200" is a string and 1200 is a number.
  • “It should be 1200.00, as JSON needs two decimal places for money” (Incorrect): JSON has no money type; 1200 and 1200.00 are the same number.
  • “Numbers aren't allowed in JSON, so the whole event should be sent as text” (Incorrect): JSON has numbers, true and false, lists and objects as well as text.
  • “It's the text "1200" in quotes, so tools may not add it up as a number” is correct.

    In JSON, quotes make a string; a number is written 1200 without them.

    • Later: event parameters with numbers (DM5, kit test 5).

📖 Revise: Module 25: APIs and JSON

10. You change the cart script and want to know you haven't broken the checkout. What's the most dependable check?

Why each option is right or wrong

  • “Open the shop once in your own browser and check that the home page loads” (Incorrect): The home page loading says little about the cart or checkout.
  • “Ask a colleague whether the checkout seems fine to them after the change” (Incorrect): An opinion isn't a check, and a quick look misses most errors.
  • “Read the changed code carefully and decide whether it looks right to you” (Incorrect): Reading helps, but it misses errors a test would catch.
  • “Run an automated test that adds items, checks out and checks the total” is correct.

    A test repeats the same journey every time and fails if the total changes.

    • Later: the kit's acceptance tests (Projects 1 to 3).
    • Also: run it twice to catch flaky results.

📖 Revise: Module 26: Debugging and Testing

← PreviousPath guide
ProLearners Assist