Optimly Developer Documentation

Site Analytics

Browser event model

In short

Review supported events, URL normalization, safe identifiers, and server matching.

The Site Insights collector accepts a small, versioned event envelope. The server resolves tenant and origin scope from the public site key and authorized request origin; the browser cannot select an organization or claim that an event matched a goal.

Event types

EventMeaningTypical goal quality
page_viewA page or supported client-side route was viewedDestination reached when a destination rule matches
link_clickAn eligible link destination was selectedEngagement
form_submitAn eligible native form submittedEngagement
custom_conversionCustomer code declared a validated success eventConfirmed outcome when configured that way

The beacon may retain the legacy conversion call shape at the browser API boundary while the collector normalizes it to the current custom-success event model.

URL handling

Optimly normalizes URLs into allowed hostname and path fields. The browser event model does not send query strings or fragments. Referrers are reduced to hostnames before collection.

Safe element and form identity

When a goal test needs an interaction candidate, the beacon prefers:

  1. an explicit data-optimly-id value;
  2. a stable HTML id;
  3. a normalized link destination or form action;
  4. a bounded signature based on safe structural attributes.

Generated CSS class names, arbitrary DOM text, and entered form values are not durable identifiers.

Server-authoritative matching

The collector matches normalized events against rules that are effective at the event's occurrence time and stores the resulting match. A browser cannot submit a conversion: true claim or choose a signal-quality label.