---
title: "Get started in 4 steps"
description: "Set up XPmetric analytics on your website in minutes — add a site, install the snippet, verify tracking, and link revenue."
source: "https://xpmetric.com/docs/getting-started"
---
Set up XPmetric on your site in four steps. You'll need a free XPmetric account.

## 1. Create a site

1. Sign in at [xpmetric.com/login](/login).
2. Open the dashboard and click **Add site**.
3. Enter your domain (e.g. `buildcove.io`).
4. Copy your **site token** from **Settings → Sites → Get Script**.

<TokenCallout />

## 2. Install the tracking script

Paste this snippet inside the `<head>` of every page so it loads before your content:

<TrackingSnippet />

Pick the guide for your stack:

- [Next.js](/docs/install/nextjs)
- [WordPress](/docs/install/wordpress)
- [Shopify](/docs/install/shopify)
- [Plain HTML](/docs/install/html)
- [Google Tag Manager](/docs/install/gtm)
- [Astro](/docs/install/astro)
- [Webflow](/docs/install/webflow)
- [Framer](/docs/install/framer)

After saving, visit your site and check the dashboard — the live feed should show a pageview within a minute.

## 3. Link revenue to traffic (optional)

Connect Stripe or Polar in **Settings → Integrations**, then pass XPmetric visitor IDs into checkout metadata:

- [Stripe Checkout attribution](/docs/revenue/stripe-checkout)
- [Polar attribution](/docs/revenue/polar)
- [Generic Payments API](/docs/revenue/payments-api)

`p.js` exposes `window.xpmetric.v` (visitor hash) and `window.xpmetric.s` (session id) for attribution.

## 4. Track conversions (optional)

Fire custom events when users sign up, subscribe, or complete key actions:

```js
window.xpmetric('signup')
```

Promote events to [conversion goals](/docs/custom-goals) or build [multi-step funnels](/docs/conversion-funnels) in the dashboard.

## Next steps

- [Import Google Analytics history](/docs/ga-import) — backfill years of pageviews in one click
- [UTM campaign tracking](/docs/utm-tracking) — works automatically with standard UTM params
- [Fix CSP blocking](/docs/troubleshooting/csp) — if your site sends strict Content-Security-Policy headers
