---
title: "Statable Analytics · Nuxt Scripts"
description: "Load the Statable tracker and record custom events."
canonical_url: "https://scripts.nuxt.com/scripts/statable-analytics"
meta:
  "og:description": "Load the Statable tracker and record custom events."
  "og:image": "https://scripts.nuxt.com/_og/s/o_b149d7fd06a2e0a3.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Statable Analytics · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_b149d7fd06a2e0a3.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Scripts**

# **Statable Analytics**

[Copy for LLMs](https://scripts.nuxt.com/scripts/statable-analytics.md)

[**Statable**](https://statable.com/) is cookie-free web analytics. It honours Do Not Track and Global Privacy Control. The [**tracking script reference**](https://statable.com/docs/developers/tracking-script/) lists its options.

This integration needs Statable's standalone tracking script, available on paid plans. The Hobby plan uses a widget bundle and has no separate tracker.

## Proxying is not supported

Statable uses the connecting IP address and user agent to count visitors. If your Nuxt server relays beacons, Statable sees the server's IP instead.

You can bundle the tracker on your Nuxt origin. Beacons still go to the Statable API. The composable sets the Site ID and API endpoint on the script tag so bundling keeps both values.

## Custom host and API endpoint

`**host**` selects where Nuxt Scripts fetches the tracker and sets the default beacon endpoint. With bundling, browsers load the tracker from your Nuxt origin. If the custom host relays beacons, set `**trackingApi**` to the Statable API so Statable sees each visitor's IP.

```ts
useScriptStatableAnalytics({
  siteId: 'YOUR_SITE_ID',
  host: 'https://stats.example.com',
  trackingApi: 'https://statable.com/api/event',
})
```

## Custom events

Use `**proxy.t(name, props)**` to record an event. Calls made before the tracker loads run once it is ready. Properties can be strings, numbers or booleans.

```ts
const { proxy } = useScriptStatableAnalytics()
function trackSignup() {
  proxy.t('Sign Up', { plan: 'pro' })
}
```

Statable can also track outbound links, downloads and elements with `**data-statable-event**`. Enable each module in Statable's Site settings. See the [**JavaScript API**](https://statable.com/docs/developers/javascript-api/).

## Sticky properties

`**props**` adds properties to every event. Nuxt Scripts renders them as `**data-statable-***` attributes.

```ts
useScriptStatableAnalytics({
  siteId: 'YOUR_SITE_ID',
  props: { env: 'production', cohort: 'beta' },
})
```

## Page views in Nuxt

The tracker counts client-side navigation without extra setup. Enable Statable's engagement module to record time and scroll depth.

## Example

The default trigger waits until Nuxt is ready:

app.vue

```vue
<script setup lang="ts">
useScriptStatableAnalytics({
  siteId: 'YOUR_SITE_ID',
})
</script>
```

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/statable-analytics.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/statable-analytics.md)

[**SpeedCurve LUX** Use SpeedCurve LUX Real User Monitoring in your Nuxt app to measure performance experienced by real users, with automatic SPA navigation tracking.](https://scripts.nuxt.com/scripts/speedcurve) [**Stripe** Load Stripe.js programmatically or embed a deferred Stripe Pricing Table.](https://scripts.nuxt.com/scripts/stripe)

**On this page **

- [Proxying is not supported](#proxying-is-not-supported)
- [Custom host and API endpoint](#custom-host-and-api-endpoint)
- [Custom events](#custom-events)
- [Sticky properties](#sticky-properties)
- [Page views in Nuxt](#page-views-in-nuxt)
- [Example](#example)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/statable-analytics#webpage","@type":"WebPage","description":"Load the Statable tracker and record custom events.","name":"Statable Analytics","url":"https://scripts.nuxt.com/scripts/statable-analytics","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/statable-analytics#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/statable-analytics"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/statable-analytics#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"Statable Analytics","item":"https://scripts.nuxt.com/scripts/statable-analytics","position":3}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
