Documentation Loading events

Track a specific page from its HTML or URL

With the Web Events skill installed, your AI agent can turn one page — a landing page, a checkout, a funnel step — into a paste-ready tracking snippet. You hand it the page and say which actions matter; it maps them to canonical Supreme events bound to the page's real elements.

Before you start

The snippet only works on a page that is already wired:

  • The Loader is installed on the page with a valid ?pid= Property id.
  • The page's domain is registered in that Property's domains list.

The skill checks for the Loader tag during page acquisition and will route you to fix the installation first if it is missing — a snippet on an unwired page fails silently by design.

Hand the page to the agent

Two ways, in order of reliability:

Paste the rendered HTML. In the browser, open the page, press F12 for developer tools, right-click the <html> element in the Elements panel, and choose Copy > Copy outerHTML. Paste that into the chat. This is the most reliable path and the only one that works for pages built by JavaScript (most page builders and SPAs).

Give the URL. The agent fetches the page itself and inventories its real forms, fields, and clickable elements. This works for server-rendered pages. If the URL returns an empty JavaScript shell, the agent will stop and ask you for the rendered HTML instead of guessing — that refusal is deliberate. A snippet bound to a selector that does not exist on the page is valid JavaScript that fires nothing.

Say what to track

Be concrete about triggers and outcomes, one per line:

On this page, track:
- submitting the form #contact as a lead
- clicking the "Start free" plan button as initiate_checkout, with the plan name as a param
- reaching the thank-you section as a custom event

Two rules the agent will hold you to, because the Node enforces them:

  • A lead must carry the email or phone the page actually collects. If the page collects neither, the agent emits contact instead — it will not invent identity.
  • A purchase or refund must carry a numeric value and a currency.

What you get back

A self-contained JavaScript snippet that waits for the Loader's window.supremeSend, binds only elements observed on your page, deduplicates repeat triggers, and sends canonical events with their params and delivery diagnostics. Production snippets are comment-free and carry no secrets and no property_id — the Property comes from the Loader's ?pid=, not from the snippet.

Paste it after the Loader tag: in the page's own code, the site's custom-JavaScript slot, or your theme's footer. It does not change the page's behavior — sends fail quietly rather than blocking a submit or a checkout.

Verify

  1. Trigger one of the mapped actions on the published page.
  2. In developer tools, confirm the request to /ingest.php on your Node domain completes with HTTP 2xx. A 403 means the page's domain is not registered in the Property; a 422 means a Property problem.
  3. Confirm the event's name and timestamp in the Console. Verify your first event covers this check and its failure modes.

An event that violates a required-field rule — a lead without identity, a purchase without value — is rejected by the Node without any browser error. If a mapped event never appears in the Console, ask the agent to re-check that event's required fields against the canonical event payload.

Limits worth knowing

  • From a URL alone, the agent cannot see content that only exists after JavaScript runs — hand it the rendered HTML in that case.
  • One page emits for one Property: the one its Loader was served for. Tracking a page under a different Property means serving that Property's Loader on it, not editing the snippet.
  • Page edits that rename or remove elements can detach the snippet's triggers. After a redesign, hand the agent the new HTML and ask it to re-validate the bindings.