# Install and verify the script > Add your website, put the tracking script on every page, confirm the first visit and set the script's options. Source: https://supametrics.io/docs/install-the-script Supametrics counts visitors with one small script (about 5 KB gzipped) on your website. It uses first-party cookies on your own domain and loads with `defer`, so it never holds up your page. This page covers adding a website, installing the script on common platforms, confirming that it works and the options you can add to the script tag. ## Add your website After you create your account, the **Add your website** screen asks for: - **Domain**: for example `example.com`. Subdomains (`www.example.com`, `app.example.com`) are included automatically; visits from any other domain are rejected. You can paste a full address; it is reduced to the domain. - **Name (optional)**: a nickname shown in the website switcher, such as `My product`. - **Currency**: the currency your Stripe prices are in. Revenue is reported in this currency only; payments in other currencies are listed but not added up. - **Timezone**: decides where each day starts on the charts. It defaults to your browser's timezone. Click **Continue**. The steps at the top of the screen (**Add website**, **Install script**, **First visit**) show where you are. You can change these later in **Site settings › General** (domain, additional domains and timezone, next to the install snippet and the installation status) and **Site settings › Revenue** (currency, next to the Stripe connection). After a domain change, visits from the old domain are rejected. After a currency change, only payments in the new currency count, including past ones. To add another website later, see [Websites and workspaces](https://supametrics.io/docs/websites). ## Copy the snippet Until the first visit arrives, the app opens on the **Setup** screen (`/setup`). Once the website is verified, `/setup` takes you to **Site settings › General**, which shows the same snippet. Copy it with **Copy snippet**. It looks like this, with your own site ID: ```html ``` Put it inside `` on every page. If your site still loads the script from `app.analyticsx.io`, our previous address, it keeps working and nothing is lost: events sent there are recorded as before. Switch to `app.supametrics.io` when convenient. The site ID is also shown as **Public site ID** under the domain in **Site settings › General**. It is not a secret: it appears in your page source, and the server only accepts data for it from your own domains. Above the snippet, **Install method** switches between **Script**, **Next.js**, **npm**, **WordPress** and **Shopify**. Two checkboxes change the snippet: - **Wait for cookie consent** adds `data-consent="required"`. See [Cookie consent](#cookie-consent). - **Cookieless / privacy mode** is marked **Soon**. It is not available yet and can't be ticked. Single-page apps (Next.js, React Router, Vue, Svelte) are tracked automatically: every route change counts as a pageview. ### Plain HTML Paste the line before `` in your site template (or in every HTML file). The same applies to any site builder or CMS that lets you add code to the page head. ### Next.js (App Router) ```tsx // app/layout.tsx import Script from 'next/script'; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( ``` Your proxy must: - Forward the request body unchanged (`POST`, sent as `text/plain`). - Forward the visitor's `User-Agent` header. Requests without one are treated as bots and dropped. - Put the visitor's IP address first in `X-Forwarded-For`. It is used for rate limits and IP exclusions, and is never stored. Behind a proxy, the country comes from the proxy's location, unless the request carries an `x-vercel-ip-country` header (Vercel adds it), in which case only the country is recorded, not the region or city. When your `data-api` address ends in `/event`, click goals load through the same proxy, from the address with `/event` replaced by `/config/` (for example `https://example.com/your-path/config/YOUR_SITE_ID`). Forward that `GET` to `https://app.supametrics.io/api/config/`. If your proxy doesn't answer it, or your `data-api` address doesn't end in `/event`, they load from the address the script itself came from. ### Identify signed-in users When someone signs up or logs in to your app, tell Supametrics who they are: ```js window.analyticsx?.('identify', { id: user.id, email: user.email, name: user.name }); ``` All three fields are optional; send what you have. Later calls fill in missing fields without clearing earlier ones. The person's name or email then shows on the **Visitors** screen, and you can search by it. Call it on every login so each browser the person uses is linked to them. See [Visitors and visitor profiles](https://supametrics.io/docs/visitors). This is personal data. Mention it in your privacy policy, and with `data-consent="required"` it is only sent after consent. ### Erase a person (deletion requests) On the **Visitors** screen, **Erase a person** finds someone by email, user ID or visitor ID across all time and deletes their visits, goals and identity from every browser they were identified on. Their payments stay in your revenue, without the link to them. This can't be undone. See [Privacy and deleting data](https://supametrics.io/docs/privacy-and-data). ### Exclude your own visits Open your site once with `?ax_ignore=true` at the end of the address (**Site settings › Exclusions** has an **Exclude this browser** button for this). That browser is never counted again. Do it in each browser you use; undo with `?ax_ignore=false`. The same tab also excludes traffic by IP address, path, hostname or country; see [Exclusions](https://supametrics.io/docs/exclusions). ### Installed before the rename Sites that use the DataFaster snippet (`/js/df.js`, `window.datafaster`) keep working unchanged: same script, same visitors, same goals. Switch to the snippet above whenever convenient. ## What is collected Per visit: pages viewed, the referring site, UTM tags (`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`) or `?ref=`, country (from the network, not GPS), device, browser and OS, and the screen size (width and height in pixels, shown next to the device in the visitor drawer). Clicks on links to other websites are recorded as **exit links** (Details › Pages › Exit links): only the link's address without its query string, and the page it was clicked on. They don't count toward your plan's events. Personal fields in URLs such as `?email=` or `?token=` are removed in the browser before anything is sent. Bots and automated browsers are ignored. Names and emails are stored only if you send them with `identify`. Traffic from AI assistants (ChatGPT, Claude, Perplexity, Gemini, Copilot and others) is grouped as its own **AI** channel. The full list of fields, cookies and rules is in [What Supametrics collects](https://supametrics.io/docs/how-tracking-works). To record conversions, continue with [Goals](https://supametrics.io/docs/goals); to credit revenue, [Connect Stripe](https://supametrics.io/docs/connect-stripe). --- This is one page of the Supametrics help center (section: Getting started). - Index of every page: https://supametrics.io/llms.txt - Every page in one file: https://supametrics.io/llms-full.txt