Skip to content

Quick Start

import { Steps, Aside, Code, Tabs, TabItem } from ‘@astrojs/starlight/components’;

Get analyze.swiss running on your website in just a few minutes.

  • An analyze.swiss account (Sign up free)
  • Access to your website’s HTML or a tag manager
  1. Sign up and create a workspace

    Go to app.analyze.swiss/register and create your account. You’ll automatically get a workspace created for you.

  2. Get your tracking code

    In your workspace settings, go to Settings → Installation to find your unique tracking snippet:

    <script
    src="https://analyze-ingest.thismatters.workers.dev/s/a.js"
    data-api-key="YOUR_API_KEY"
    data-auto-capture="true"
    defer>
    </script>
  3. Add to your website

    Paste the script in your website’s <head> section, just before the closing </head> tag.

  4. Verify installation

    Visit your website and check your analyze.swiss dashboard. You should see your first pageview within seconds!

```html My Website ``` ```bash npm install @analyze.swiss/react ```
```tsx
// app/layout.tsx (Next.js App Router)
import { AnalyzeProvider } from '@analyze.swiss/react';
export default function RootLayout({ children }) {
return (
<html>
<body>
<AnalyzeProvider apiKey="YOUR_API_KEY">
{children}
</AnalyzeProvider>
</body>
</html>
);
}
```
```html export default defineNuxtConfig({ app: { head: { script: [ { src: 'https://analyze-ingest.thismatters.workers.dev/s/a.js', 'data-api-key': 'YOUR_API_KEY', 'data-auto-capture': 'true', defer: true } ] } } }) ```

With data-auto-capture="true", analyze.swiss automatically tracks:

EventDescription
PageviewsEvery page navigation
ClicksButton and link clicks
Form SubmissionsForm submit events
Scroll Depth25%, 50%, 75%, 100%
Engagement TimeActive time on page
Outbound LinksExternal link clicks
File DownloadsPDF, ZIP, etc.

Track specific actions important to your business:

// Track a signup
analyze.track('signup', {
plan: 'pro',
source: 'landing_page'
});
// Track a purchase
analyze.track('purchase', {
order_id: '12345',
revenue: 99.00,
currency: 'USD'
});

Connect anonymous activity to known users:

// After user logs in
analyze.identify('user_123', {
email: 'user@example.com',
name: 'John Doe',
plan: 'enterprise'
});