Guide - Measurement

Measurement validation for funnel numbers

Use this guide before you read a funnel rate. It states the defects found in public/site.js in this pack, the dedup key for each event, the order and timezone rule, the sign-in boundary for UTM and referrer values, and the queries that show whether client and server counts agree.

What was found in this pack

Each item below was read in public/site.js, public/passenger-book.html, public/app/passenger-book.html, and public/app/index.html in this pack. A number that follows a defect below must not be read until the check for that defect passes.

Duplicate events

site_section_view in public/site.js can fire more than once per section per load when a section leaves and re-enters, because a new one second timer is made on each entry. app_install_decision fires on any document click when an install offer is deferred, so a normal link click also counts as an install decision. cta_click in public/site.js fires for any button or link, for destinations outside /request-demo, /app/, and /passenger-book, and for a submit button with no href as form_submit.

Missing events

quote_form_start, quote_preview_request, quote_request_submit_success, quote_request_submit_error, booking_status_view, booking_change_submit_success, and booking_change_submit_error are listed in the measurement plan and are not recorded in public/site.js or in the passenger book scripts in this pack. Quote and booking change drop-off therefore shows no value until those events are recorded with the keys below. Do not estimate those steps from server logs or from Quote bookings.

Out of order events

Records in window.__chauffeurdeskAnalytics carry occurred_at from the device clock and carry no sequence in their load. A clock change can reorder page_view, cta_click, and form steps. Section and install events have no funnel order in the catalog and must not be placed in a funnel ratio.

Timezone inconsistent events

occurred_at can be grouped by device local date by a reader. That moves an event near midnight UTC to the wrong date. Funnel counts use utc_date in UTC. Workspace reports use pickup date in company timezone. Those are two different date rules and must be stated separately on any screen that shows a count.

UTM and referrer at sign-in and workspace switching

refPath in public/site.js keeps only pathname from document.referrer and drops query and hash, so UTM values are dropped. session_id and view_id are fresh on each load. public/app/index.html does not load public/site.js. UTM, referrer, session, and view values therefore do not carry across MAJIC sign-in or workspace switching, and no per person join by those values is allowed in the measurement plan. A rate that needs UTM or referrer shows no value until a UTM daily aggregate is recorded under the same privacy rules.

Client and server double counting

demo_form_submit_success is recorded in the browser after POST /api/public/request returns ok, and the same submission is also the lead record sent to that endpoint. Adding the client count and the server count counts one submission twice. Retries in public/site.js reuse one Idempotency-Key, while the client event in this pack carries no dedup key. The duplicate passenger book copy at /app/passenger-book also creates a second quote path for the same form.

Non canonical names and fields

site_page_view, site_cta_click, signin_start_click, site_section_view, app_install_offer_seen, app_install_decision, session_id, view_id, page_title, referrer_path, cta_label, cta_section, section_id, section_index, visible_ms, install_source, and install_outcome are not in the catalog in the measurement plan. signin_start_click counts a click to /app/ as a sign-in start, which the measurement plan states is not a sign-in start until /app/ loads and the app shows the sign-in step.

What this guide does not change

This guide adds no event, no script from an outside host, no cookie, no third party recipient, and no sign-in path. It does not change booking fields, rates, call time, status, or workspace scope. It states how to check numbers that the catalog already defines.

Dedup key for each event

Build the dedup key in this order, event name, page_path, utc_date, the allowed properties for that event, and the load or submission part stated below. Count distinct dedup keys in a daily aggregate. Two records with one dedup key count once. A reload is a new load and counts again for page_view, as the measurement plan states.

page_view

Key: page_view, page_path, utc_date, page_load_id, where page_load_id is one fresh random value per load. The random value is a dedup key only. It is never stored as session_id or view_id and never sent after the daily count.

cta_click

Key: cta_click, page_path, cta_target, cta_location, utc_date, click_seq, where click_seq rises by one per click in that load and cta_target is one of /request-demo, /app/, /passenger-book. One click is one count. A second listener fire in the same tick with the same click_seq collapses to one count.

demo_form_start

Key: demo_form_start, page_path, form_kind, utc_date. One per form per load, from the first input or change, as the fired flag in public/site.js already states.

demo_form_submit_success and demo_form_submit_error

Key: the Idempotency-Key of the outbox entry, entry.id in public/site.js, sent as the Idempotency-Key header on POST /api/public/request. The client emits once after ok for success, or once after the final attempt for error. Retries with the same key do not emit per attempt and do not create a second server record.

quote_form_start

Key: quote_form_start, /passenger-book, utc_date, page_load_id. One per load on /passenger-book only. The copy at /app/passenger-book is excluded, so the same form is not counted twice.

quote_preview_request

Key: quote_preview_request, page_path, service_type, utc_date, preview_seq, where preview_seq rises by one per distinct service_type rendered in that load. A cached render counts once per service_type per load. A retry of the same fetch in that load does not count again.

quote_request_submit_success and quote_request_submit_error

Key: the Idempotency-Key sent on POST /api/publicbook/public/request in the passenger book script. The client emits once for the final result, not per attempt.

booking_status_view and booking_change_submit_success and booking_change_submit_error

booking_status_view key: booking_status_view, utc_date, status_load_id, one per successful status load, with no token in the key. Change keys: the Idempotency-Key on the submit, reschedule, or cancel POST, with change_type as update, reschedule, or cancel.

signin_start and signin_complete

Measured in the app only. signin_start key: signin_start, utc_date, app_load_id, one per /app/ load for a person who is not signed in. signin_complete key: signin_complete, utc_date, workspace_open_id, counted once per new workspace. A cta_click to /app/ is never a signin_start key and never a signin_complete key.

Events with no dedup key in a funnel

site_section_view, app_install_offer_seen, and app_install_decision have no key in this guide and no place in a funnel ratio. Do not add them to a numerator or a denominator.

Order and timezone rules

Use these two rules on every funnel screen, export, and query.

Order by sequence, not by device clock

Each emit in one load carries seq, an integer that rises by one per emit in that load. Sort by page_load_id, then seq. Do not sort funnel steps by occurred_at. A device clock change must not reorder page_view, cta_click, demo_form_start, and demo_form_submit_success.

utc_date is the only funnel date

utc_date is the first ten characters of the UTC instant, for example the date part of the ISO instant in UTC. Never use device local date. Never use company timezone for a funnel count. Pickup date in company timezone is for workspace reports only and must be labelled as such when both dates appear on one screen.

  • Every event carries event, page_path where listed in the catalog, utc_date, seq, dedup_key, and only the allowed properties for that event
  • No event carries session_id, view_id, page_title, referrer, referrer_path, query, hash, token, workspace identifier, person identifier, form values, amounts, pickup places, or flight details
  • When Do Not Track is set, no event is recorded for that visit, in the browser or in a daily aggregate

Sign-in boundary and workspace switching

Marketing pages and the app are two measurement places joined only by utc_date aggregate, as the measurement plan states.

At the click to /app/

Record cta_click with cta_target /app/ on the marketing page only. Do not record signin_start, signin_complete, UTM, referrer, session, view, or token at that click.

In the app

Record signin_start only when /app/ loads for a person who is not signed in. Record signin_complete only when the first successful sign-in opens a workspace, once per new workspace. Switching workspace does not create a second signin_complete for a workspace that is already open, and opening a second workspace counts that second workspace once.

UTM and referrer values

UTM query values and referrer values are not recorded in a funnel event in this pack and are not passed to /app/. Do not join a marketing page_view to a signed-in workspace by UTM, referrer, session, view, or token. Join signin_complete to the funnel only by utc_date aggregate, with numerator, denominator, page set, and utc_date range stated.

Small cells and zero denominators

Suppress a daily cell that could identify a person and show no value for that cell. When a denominator is zero, show no value and state the next step. Do not show zero percent.

Client and server reconciliation

Count one source per step. The table below states the one source to count.

Demo submissions

Count server submissions from POST /api/public/request by form_kind, page_path, and utc_date, deduped by Idempotency-Key, or count client demo_form_submit_success records deduped by the same key. Never add the two counts together. The difference between the two deduped counts must be zero for the same utc_date and form_kind.

Quote bookings

Count server Quote bookings from POST /api/publicbook/public/request, or count client quote_request_submit_success records deduped by its Idempotency-Key. Never add the two counts together. A Quote booking is not a page_view and must not be relabelled as one.

Quote previews

Count quote_preview_request records deduped as above. Do not count raw GET requests to /api/publicbook/public/quote, because the home estimator and the passenger book form, the preview cache, and fetch retries each create extra GET requests for one rendered preview.

Sign-in funnel

Count cta_click to /app/ on marketing pages, signin_start in the app, and signin_complete in the app as three separate daily aggregates. Do not count a cta_click as a start, and do not count a start as a completion.

Validation queries

Run the browser queries on window.__chauffeurdeskAnalytics before a daily count is made. Run the aggregate queries on the daily count table with columns event_name, page_path, utc_date, form_kind, service_type, cta_target, change_type, error_class, and cnt. Expected results are stated under each query.

Browser query 1: duplicate dedup keys

const rows = window.__chauffeurdeskAnalytics || [];
const seen = {};
const dup = [];
rows.forEach(function(r){ const k = r.dedup_key || 'missing'; if (seen[k]) { dup.push(k); } seen[k] = true; });
dup

Expected after the fix: dup is empty for demo_form_start, demo_form_submit_success, demo_form_submit_error, quote_form_start, and booking change events. For page_view and cta_click, dedup_key is unique per load or per click, so dup is empty within one load. In this pack, dedup_key is missing on every record, so this query lists missing keys.

Browser query 2: prohibited fields and non canonical names

const rows = window.__chauffeurdeskAnalytics || [];
rows.filter(function(r){ return ('session_id' in r) || ('view_id' in r) || ('page_title' in r) || ('referrer_path' in r) || ('cta_label' in r) || r.event === 'site_page_view' || r.event === 'site_cta_click' || r.event === 'signin_start_click' || r.event === 'site_section_view'; })

Expected after the fix: an empty list. In this pack, this query lists the records that carry those fields and names.

Browser query 3: timezone and order

const rows = window.__chauffeurdeskAnalytics || [];
rows.filter(function(r){ return r.utc_date !== String(r.occurred_at || '').slice(0, 10); })

Expected after the fix: records carry utc_date only, with no occurred_at field, and seq rises in order within each page_load_id. In this pack, this query lists records whose utc_date is missing or whose device local grouping would move the event to another date.

Aggregate query 1: funnel order

SELECT a.utc_date, a.event_name AS earlier_event, b.event_name AS later_event, a.cnt AS earlier_cnt, b.cnt AS later_cnt FROM daily_counts a JOIN daily_counts b ON b.utc_date = a.utc_date AND b.page_path = a.page_path WHERE a.event_name = 'page_view' AND b.event_name = 'demo_form_start' AND b.cnt > a.cnt

Expected: no rows for a correct funnel on one page set. Repeat the same join for page_view to quote_form_start, quote_form_start to quote_preview_request, and quote_preview_request to quote_request_submit_success, with page_path /passenger-book for the quote funnel.

Aggregate query 2: sign-in order

SELECT utc_date, SUM(CASE WHEN event_name = 'cta_click' AND cta_target = '/app/' THEN cnt ELSE 0 END) AS clicks, SUM(CASE WHEN event_name = 'signin_start' THEN cnt ELSE 0 END) AS starts, SUM(CASE WHEN event_name = 'signin_complete' THEN cnt ELSE 0 END) AS completes FROM daily_counts GROUP BY utc_date HAVING SUM(CASE WHEN event_name = 'signin_start' THEN cnt ELSE 0 END) > SUM(CASE WHEN event_name = 'cta_click' AND cta_target = '/app/' THEN cnt ELSE 0 END) OR SUM(CASE WHEN event_name = 'signin_complete' THEN cnt ELSE 0 END) > SUM(CASE WHEN event_name = 'signin_start' THEN cnt ELSE 0 END)

Expected: no rows. A row means a start was counted at a click, or a completion was counted without a start in the app.

Aggregate query 3: client and server reconciliation

SELECT c.utc_date, c.form_kind, c.cnt AS client_cnt, s.cnt AS server_cnt, c.cnt - s.cnt AS diff FROM client_daily c JOIN server_daily s ON s.utc_date = c.utc_date AND s.form_kind = c.form_kind WHERE c.cnt - s.cnt <> 0

Expected: no rows, where client_daily counts demo_form_submit_success deduped by Idempotency-Key and server_daily counts POST /api/public/request submissions deduped by the same key. Never use client_cnt plus server_cnt as a total.

Aggregate query 4: duplicate server submissions

SELECT idempotency_key, COUNT(*) AS n FROM server_submissions GROUP BY idempotency_key, form_kind, utc_date HAVING COUNT(*) > 1

Expected: no rows. A row means a retry created a second lead record or a second Quote booking with one key.

Acceptance checks before you read a rate

Run each check and record the result on the count screen. Each check names the screen, the field, and the result.

  • Browser query 1 lists no duplicate dedup key for demo, quote, and booking change events, and browser query 2 lists no prohibited field and no non canonical event name
  • Every record carries utc_date in UTC and seq in load order, and no record carries occurred_at as a grouping date
  • Aggregate query 1 lists no later step count above an earlier step count for one utc_date and one page set, for demo, quote, and sign-in funnels
  • Aggregate query 2 lists no signin_start count above cta_click to /app/ count and no signin_complete count above signin_start count for one utc_date
  • Aggregate query 3 lists no difference between deduped client demo submissions and deduped server submissions for one utc_date and form_kind, and no total is formed by adding the two counts
  • Aggregate query 4 lists no duplicate Idempotency-Key in server submissions, and quote_preview_request counts one rendered preview per service_type per load, not one per GET request or retry
  • No funnel screen shows a session, view, title, referrer, UTM, token, workspace, or person identifier, and no screen joins a marketing view to a signed-in workspace except by utc_date aggregate
  • When a denominator is zero, the screen shows no value and states the next step, and missing quote and booking change steps show no value until they are recorded with the keys above

Read the funnel only from a checked count

Run the dedup, timezone, sign-in, and reconciliation checks above, then read the rate with numerator, denominator, page set, and utc_date range stated.