Custom conversion goals
Track signups, clicks, and other conversions with window.xpmetric() custom events.
Conversion goals turn custom events into dashboard metrics — completion counts and conversion rate (CVR) — without extra schema setup.
1. Fire a custom event
After p.js is installed, call:
window.xpmetric('signup')Examples:
// After successful signup API response
window.xpmetric('signup');
// Newsletter subscribe
window.xpmetric('newsletter_subscribe');
// Pricing CTA click (when action completes)
window.xpmetric('pricing_cta_click');The event name is a free-form string. Use lowercase with underscores for consistency.
2. Create a goal in the dashboard
- Open your site dashboard.
- Find the Goals card and click Add goal.
- Pick a discovered event or enter the exact event name.
- Save.
XPmetric counts completions from ClickHouse event_type = 'custom' rows matching your event name. Goals are retroactive — history before you created the goal still counts.
Limits
- Max 10 active goals per site
- Event names must match exactly (case-sensitive)
- Requires
p.json the page where the event fires
Verify
Fire the event on your site, wait for the next dashboard poll (~60s), and check the Goals card for a new completion.
Related
- Conversion funnels — chain pageviews and events into multi-step flows
- Get started — install the tracker first