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 trafficdevelopment: localhost and dev traffic (requiresallowLocalhost: trueon the project)
Pass envId when listing or creating goals for a non-production environment.
Typical workflow
- Create page or event goals with
createGoalafter your tracker is installed - List existing goals with
listGoalsbefore syncing from CI - Update definitions with
updateGoalwhen paths or event names change - Fetch dashboard-ready conversion totals, comparison, and time series with
getGoalStats
Methods
Access goal methods via clics.goals.
Related
- Goals in the dashboard: create and review goals in the UI
- Custom events: send
eventgoals withtrack() - Stats: query conversion metrics programmatically