Skip to content
Clics privacy-friendly cookieless web analytics documentation
Esc
navigateopen⌘Jpreview
On this page

Manage conversion goals with the Clics TypeScript SDK

Copy page

Goals

Manage page, custom-event, outbound-link, and scroll-depth conversion goals with the Clics TypeScript SDK.

A goal defines a conversion: an action that counts as success for your product. Goals power conversion metrics on the dashboard and can be filtered in queryStats.

Goals are optional. You only need them when you want to measure signups, purchases, or custom events beyond raw pageviews.

Goal types

Type Triggers when Required field
page A visitor views a specific path rule.pagePath: e.g. /signup, /pricing
event Your site sends a custom event via track() rule.eventName: e.g. purchase, trial_started
outbound A visitor clicks one exact external URL rule.outboundUrl: e.g. https://example.com/docs
scroll_depth A visitor reaches a percentage on a page rule.pagePath and rule.scrollDepthThreshold: e.g. /article, 75

Page paths support a single trailing wildcard (/blog/*). Each path or event name must be unique per project and environment.

Environments

Goals are scoped to an environment:

  • production (default): live site traffic
  • development: localhost and dev traffic (requires allowLocalhost: true on the project)

Pass envId when listing or creating goals for a non-production environment.

Typical workflow

  1. Create page or event goals with createGoal after your tracker is installed
  2. List existing goals with listGoals before syncing from CI
  3. Update definitions with updateGoal when paths or event names change
  4. Fetch dashboard-ready conversion totals, comparison, and time series with getGoalStats

Methods

Access goal methods via clics.goals.

Was this page helpful?