Documentation

How it works

Four moving parts. Knowing which one produced a number tells you how fresh it is, how much you can trust it, and what to do when it looks wrong.

1. The storefront tracker

A Shopify theme app embed. When you switch on Click Context Tracker in the theme editor, it loads a script on every storefront page and records what visitors do: page views, clicks with their coordinates and target element, scroll depth, section visibility, hover dwell, form field behaviour, JavaScript errors, Core Web Vitals, and a pruned snapshot of the rendered DOM.

It runs on your storefront, so it sees the theme as shoppers see it. That is why get_page_dom_snapshot can show the real page without anyone opening a browser.

2. The Shopify web pixel

A separate extension running in Shopify's sandbox. It subscribes to the customer events Shopify emits — product viewed, added to cart, removed from cart, checkout started, address submitted, shipping submitted, payment info submitted, checkout completed, collection viewed, search submitted.

It exists because the theme tracker cannot see checkout. Shopify hosts those pages, and only a pixel is allowed in. Everything the funnel knows past “added to cart” comes from here, and so does every revenue figure on the server.

Why revenue is gross

The pixel observes one moment — checkout completion — and never learns what happened afterwards. Returns, cancellations and post-purchase edits are invisible to it, so revenue reads high. Consent gating and ad blockers hide some orders, so the order count reads low. Details in Metrics and money.

3. The pipeline

Raw events land continuously and are queryable within seconds. A nightly job at roughly 00:00 UTC then does the work that needs a complete day:

  • Rolls page views and funnel events into daily aggregates, counted by session rather than by event.
  • Enriches sessions with engagement and frustration scores, and marks which ones converted and for how much.
  • Runs anomaly detection, conversion correlations with multiple-comparison correction, and opportunity sizing.
  • Generates session summaries for the sessions that qualify, on Growth and above.

This split is the single most important thing to understand about the data, because it means two different tools can disagree about today. See Data freshness.

4. The MCP server

37 tools over the Model Context Protocol, at app.clickcontext.com. Your assistant authenticates with an OAuth token or an API key, and the server resolves which store you are from that credential — you never pass a store id.

At handshake the server also sends an instruction set and exposes 21 playbooks as MCP resources. The instructions are what make the answers useful rather than merely accurate: they tell the assistant to rank by money, split every store-wide number, and apply sample-size gates before claiming anything.

Bot exclusion

Declared crawlers are excluded at ingest, before any rate is computed. The practical consequence is that Click Context reports fewer sessions and better conversion than GA4 or Shopify for the same window. That gap is the correction working, not a tracking discrepancy.

AI-agent traffic is flagged separately rather than dropped, because agent sessions are worth counting but do not behave like humans. get_session_insights reports them as agentSessions.

The dashboard's role

The Shopify admin app is not where the analysis happens. It exists to get you connected, show a nightly digest and a live findings feed, and confirm that data is arriving and that your assistant has reached the server.

At a glance

Storefront data
Theme app embed — clicks, scroll, hovers, forms, errors, vitals, DOM
Checkout data
Shopify web pixel — cart and checkout steps, orders, revenue
Catalogue data
Shopify product webhooks, within seconds of a change
Raw event latency
Seconds
Aggregate latency
Nightly, roughly 00:00 UTC
Access
MCP over streamable HTTP, OAuth or bearer API key