Skip to main content
Add one key to a node and that interaction is reported to the page’s analytics. You choose the moments. Nothing is measured unless you say so. Analytics here means what a person did in your experience. Which items they opened, what they clicked, where they stopped. It is separate from platform monitoring, which measures whether the machinery is healthy.

The one key

analytics sits on a node, beside the action it accompanies.
Two fields. event is the name that arrives in the analytics tool. params are the values sent with it. {{...}} reads the data already in scope at that node. It is the same binding an action’s values use, so there is nothing new to learn. A node with no analytics block reports nothing. Silence is the default.

Opening a view is an action

A card and its detail view are one instance. Opening the detail view writes view (the public state; legacy spelling defaultState), which is an action like any other. So it takes the same key.
Clicks, submits and view changes are one mechanism. There is no separate way to report a view, because there is no separate way to open one.

Choosing event names

Use the analytics tool’s own vocabulary where it has a word for what happened. GA4 defines view_item, generate_lead, select_item and others. Those names populate its built-in reports with no setup. Invent a name only when no standard one fits. Prefix it with unoverse_ so it cannot collide with an event the page already fires. Names are yours to choose. The platform holds no list.

Choosing params

Send what answers a question somebody will ask. Leave out anything that only describes the machinery. Match the field names the customer’s own analytics already uses. Their reports and filters are built on those names, so a matching param joins work they have already done. A generic name arrives as a column somebody has to map by hand.
A param that resolves to nothing is dropped. An absent value is absent in the report, never an empty column that reads as data.

What never goes in an event

Three rules, and breaking any of them is a data protection problem rather than a bug. No personal data. No name, email, phone or date of birth. Analytics tools prohibit it, and the property receiving it belongs to your customer. No authored content. Report which item somebody opened. Never report what it said. No typed text. A person’s question or form entry stays out. Both routinely contain personal detail. An enquiry event carries an opaque reference to the record, never the record.

One event per kind of thing

A course, a product and a service are the same moment. Somebody looked at one thing in detail. Give them one event and separate them with a param.
Splitting them into view_course and view_product fragments the reporting. An analytics tool breaks one event down by param automatically. It cannot recombine two event names into one funnel.

Where events go is not your decision

You declare what happened. The destination is configured per customer, outside rx/. The reason is practical. The same template runs on a customer’s site, in the Unoverse client, and inside an MCP app host. Each has a different destination, or none. A template cannot know which one it is in. Analytics is off unless a customer has been configured. Your declarations sit dormant until then, and cost nothing.

Checking your events

Turn on debug for the channel you are testing. Each event prints as it fires.
Filter the browser console on unoverse:analytics to see only these.

Troubleshooting


  • Components for the node grammar
  • State for how a view change is a state write
  • Lifecycle Hooks for fetching data at a moment, which is a different job