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

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

**Scripts**

# **Pulse Analytics**

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

[**Pulse**](https://pulse.ciphera.net/) is cookie-free web analytics by [**Ciphera**](https://ciphera.net/). The tracker leaves nothing in the browser, no cookie and no stored identifier; Pulse works out who a visitor is on its own servers, from rotating hashes. It honours Do Not Track and Global Privacy Control without extra config. The [**script reference**](https://docs.ciphera.net/pulse/script-installation) lists every attribute this composable maps.

**Pulse Analytics**

[**View source **](https://github.com/nuxt/scripts/blob/main/packages/script/src/runtime/registry/pulse-analytics.ts)

## Nuxt Config Setup

Add this to your `**nuxt.config.ts**` to load Pulse Analytics globally. Alternatively you can use the **useScriptPulseAnalytics** composable for more control.

```
export default defineNuxtConfig({
  scripts: {
    registry: {
      pulseAnalytics: {
        trigger: 'onNuxtReady',
      }
    }
  }
})
```

This config automatically enables **first-party mode ** (bundle). See below to customise.

## useScriptPulseAnalytics()

The `**useScriptPulseAnalytics**` composable lets you have fine-grain control over when and how Pulse Analytics is loaded on your site.

```
const { proxy } = useScriptPulseAnalytics()
```

Please follow the [**Registry Scripts **](https://scripts.nuxt.com/docs/guides/registry-scripts) guide to learn more about advanced usage.

## First-Party Mode: Privacy Focused Proxy

No extra config needed. The script is bundled and served from your domain instead of a third-party CDN, eliminating an extra DNS lookup and improving load times. [**Learn more. **](https://scripts.nuxt.com/docs/guides/first-party)

**Mode**

Bundle

```
export default defineNuxtConfig({
  scripts: {
    // ✅ First-party mode: bundled
    registry: {
      pulseAnalytics: {
        trigger: 'onNuxtReady',
      },
    },
  },
})
```

## Example

Using Pulse Analytics in a component.

ConversionButton.vue

```
<script setup lang="ts">
const { proxy } = useScriptPulseAnalytics()

// noop in development, ssr
// just works in production, client
function handleAction() {
  // use proxy methods here
}
</script>

<template>
  <div>
    <button @click="handleAction">
      Send Event
    </button>
  </div>
</template>
```

## Proxying is not supported

Pulse builds visitor identity on its server from the connecting IP address and user agent. Route the beacons through your Nuxt server and they all arrive from one IP, so every visitor on the same user agent collapses into a single identity. Its [**bot filtering**](https://docs.ciphera.net/pulse/bot-filtering) counts a datacenter or hosting-provider origin as a signal too, which is where a proxied server sits.

So Nuxt Scripts bundles the tracker and serves it from your origin, but its beacons go straight to the Pulse API. Nothing is lost client-side: the tracker keeps no identifier in the browser for a first-party proxy to shield.

## Self-hosted or proxied API

`**apiUrl**` sets the origin the tracker posts to. Leave it unset for the hosted Pulse API.

```ts
useScriptPulseAnalytics({
  domain: 'YOUR_DOMAIN',
  apiUrl: 'https://pulse-api.example.com',
})
```

## Custom events

Use the composable's `**proxy**` object for `**track**` calls. Call it before the script has loaded and Nuxt Scripts holds the call, then replays it once the tracker is in. If the visitor has opted out, the tracker never runs and the queue is dropped.

```ts
const { proxy } = useScriptPulseAnalytics()
function trackSignup() {
  proxy.track('signup', { plan: 'pro' })
}
```

Event names may contain letters, numbers and underscores. Property values must be strings, and the optional third argument is revenue. See the [**custom events reference**](https://docs.ciphera.net/pulse/custom-events).

`**domain**``string`** required **

The site domain as registered in Pulse.

`**apiUrl**``string` = 'https://pulse-api.ciphera.net'

The API origin the tracker posts events to. Only needed for a self-hosted or reverse-proxied Pulse API.

`**trackScroll**``boolean` = true

Record scroll depth.

`**trackOutbound**``boolean` = true

Record outbound link clicks as \`outbound\_link\` events.

`**trackDownloads**``boolean` = true

Record file download clicks as \`file\_download\` events.

## Example

The default trigger waits until Nuxt is ready:

app.vue

```vue
<script setup lang="ts">
useScriptPulseAnalytics({
  domain: 'YOUR_DOMAIN',
})
</script>
```

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

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

[**PostHog** Load posthog-js with first-party proxy support, feature flags, and opt-in or opt-out controls.](https://scripts.nuxt.com/scripts/posthog) [**Reddit Pixel** Load Reddit Pixel and send page visits or conversion events through its typed API.](https://scripts.nuxt.com/scripts/reddit-pixel)

**On this page **

- [Proxying is not supported](#proxying-is-not-supported)
- [Self-hosted or proxied API](#self-hosted-or-proxied-api)
- [Custom events](#custom-events)
- [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/pulse-analytics#webpage","@type":"WebPage","description":"Load the Pulse tracker and record custom events.","name":"Pulse Analytics","url":"https://scripts.nuxt.com/scripts/pulse-analytics","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/pulse-analytics#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/pulse-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/pulse-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":"Pulse Analytics","item":"https://scripts.nuxt.com/scripts/pulse-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.
