Events
Custom events measure important outcomes on a website: a completed purchase, sign-up, download, lead submission, successful search, or meaningful button click.
Events use the TypeUI Insights snippet already installed on the website. You do not create an event in Cloudflare or register its name in TypeUI first.
Track an event
Call the public helper after analytics consent:
window.trackTypeUIEvent("signup");
Track a successful purchase with an optional numeric value and three-letter currency code:
window.trackTypeUIEvent("purchase", {
value: 49,
currency: "USD",
});
Other useful examples:
window.trackTypeUIEvent("pricing.cta_click");
window.trackTypeUIEvent("whitepaper_download");
window.trackTypeUIEvent("contact_form_success");
The helper returns true when the event is accepted or queued and false when it cannot be collected.
Track outcomes, not attempts
Send an event only after the action succeeds. For example, track purchase after the payment provider confirms the order, not when the visitor first presses the checkout button.
async function completeSignup(formData) {
const response = await createAccount(formData);
if (response.ok) {
window.trackTypeUIEvent("signup");
}
}
This keeps the event count useful as a conversion metric.
Event names and values
Event names can contain letters, numbers, dots, underscores, colons, and dashes. Use stable names that describe the completed action.
The optional event object accepts:
| Field | Type | Description |
|---|---|---|
value | Number | A finite numeric value associated with the event |
currency | String | A three-letter ISO currency code such as USD or EUR |
TypeUI Insights intentionally does not accept arbitrary event metadata. Do not place names, email addresses, order IDs, account IDs, typed text, or other personal data in an event name.
Consent behavior
trackTypeUIEvent() does not collect an event before analytics consent. If consent is active but the external tracker is still loading, the installation snippet can queue a short burst of events and deliver them after the tracker is ready.
Withdrawing analytics consent clears pending events and disables further collection.
Analyze conversions
The Custom events card ranks the most frequent events and shows their count, associated user sessions, comparison change, and total monetary value when a currency is present.
Custom events are also included in:
SUMMARY.mdas an AI-ready conversion table- CSV exports for the current period and comparison
- The same global date range and analytics context as traffic, audience, campaigns, pages, and interaction data
Use this SUMMARY.md to explain our signup funnel. Compare signup events with sessions and landing pages, identify likely drop-off points from the journeys and heatmap data, and propose three measurable UI experiments.
Suggested event plan
Start with a small set of business outcomes:
| Goal | Suggested event |
|---|---|
| New account created | signup |
| Purchase completed | purchase |
| Qualified lead submitted | lead_submit |
| Important file downloaded | download |
| Primary pricing CTA used | pricing.cta_click |
Add an event when it answers a decision you plan to make. A short, consistent event list is easier to understand than tracking every interaction as a conversion.