Skip to content

Get started

Quick start

Add one script tag, see your first visitor on the globe, and verify the install.

Three steps: create a site, paste one tag, open the live view. Replace SITE_ID in the snippets with the id shown in Settings → Tracking code.

Add a site

  1. Create an account

    Sign up, or sign in to your own server. Self-hosting? See Self-hosting first.

  2. Add your website

    Enter its name, domain, timezone (detected for you) and currency. Subdomains of the domain are accepted automatically.

  3. Copy the snippet

    The setup screen shows the tag with your site id filled in, and waits for your first visitor.

Install the script

Add the tag to every page, once. Client-side navigations in single-page apps are tracked automatically, so you don’t need a router listener.

<!-- in the <head> of every page -->
<script defer data-site="SITE_ID" src="https://globatics.live/script.js"></script>
<!-- optional: queue calls made before the script loads -->
<script>window.globatics=window.globatics||function(){(window.globatics.q=window.globatics.q||[]).push(arguments)}</script>

Using GTM

Create the script element in JavaScript as shown, so GTM keeps the data-site attribute. To forward specific dataLayer events, add another Custom HTML tag on a Custom Event trigger: window.globatics && window.globatics('event', {{Event}});

Install with an AI coding agent

Paste this prompt into Claude Code, Cursor, Copilot or another coding agent. It installs the tag the right way for your framework and tracks your key conversions.

Prompt
Add Globatics analytics to this project.

1. Load this script on every page, once, as early as possible without blocking rendering:
   <script defer data-site="SITE_ID" src="https://globatics.live/script.js"></script>
   - Next.js App Router: use next/script <Script src=... data-site="SITE_ID" strategy="afterInteractive" /> in app/layout.tsx.
   - Next.js Pages Router: same <Script> in pages/_app.tsx.
   - Vite/React/Vue/Svelte SPA: put the tag in index.html.
   - Server-rendered templates: put it in the shared <head> partial.
   Do NOT add a router listener: SPA navigations are tracked automatically.
2. Do not add a cookie banner entry for it and do not wrap it in consent logic: it sets no cookies
   and stores nothing in the browser (unless data-persist is added on purpose).
3. Track the key conversions with window.globatics:
   - signups:   window.globatics?.('event', 'signup', { plan })
   - purchases: window.globatics?.('event', 'purchase', { plan }, { revenue: amount, currency: 'USD' })
   Use snake_case event names; never start them with "$" (reserved). Props must be flat
   (string, number, boolean or null), max 30 per event.
4. If the app has logged-in users, call window.globatics?.('identify', user.id, { name, plan })
   after login, and window.globatics?.('reset') on logout. Never send passwords or tokens.
5. In TypeScript, declare `globatics?: (...args: unknown[]) => void` on the Window interface.
6. Do not change anything else. Afterwards, list the files you changed.

Verify the install

Open your site in another tab and keep it visible. Within a second you appear on the live globe. In your browser’s DevTools, the Network tab shows a collect request on load (answered with 202) and a heartbeat every 15 seconds.

The setup screen also has a Send a test visit button. The test visit goes through the real pipeline, lands on the globe labelled “This is you”, and is kept out of your reports.

Nothing shows up?

Check that the page’s hostname is your site’s domain (or listed in allowed hostnames), that localhost isn’t ignored in the site settings, and that a blocker isn’t hiding the request. Proxying solves the last one.

Exclude your own visits

Open any page of your site with #globatics-ignore at the end of the URL. That browser stops being counted until you open a page with #globatics-unignore. You can also call globatics('optout').