Source: https://usedataowl.com/docs/install-datasense
Markdown source: https://usedataowl.com/docs/install-datasense.md
Description: Step-by-step installation guides for adding lightweight cookieless analytics and session replay to Next.js, React, Vue, Astro, WordPress, Shopify, and Framer.

# Install Web Analytics Across Any Framework or CMS

The script is the same everywhere: load it once on every page, inside `<head>`. Don't bundle it or add it twice. Copy it from **Settings → Installation**, where your site ID is filled in.

```html
<script
  defer
  data-website-id="YOUR_SITE_ID"
  src="https://usedataowl.com/js/script.cookies.js"
></script>
```

There are two builds. `/js/script.cookies.js` (the default for new sites) recognizes returning visitors with a first-party cookie. `/js/script.js` stores nothing on the device. See [GDPR and cookieless tracking](/docs/gdpr-cookieless-tracking).

## Guides

- [Next.js](/docs/nextjs-app-router)
- [React, Vite and React Router](/docs/react-router)
- [Vue.js](/docs/vuejs)
- [Astro](/docs/astro)
- [WordPress](/docs/wordpress)
- [Shopify](/docs/shopify)
- [Webflow](/docs/webflow)
- [Framer](/docs/framer)
- [Squarespace](/docs/squarespace)
- [Wix](/docs/wix)
- [Google Tag Manager](/docs/google-tag-manager)
- [Lovable, Bolt and v0](/docs/lovable)

## Single-page apps

Route changes made with the History API (React Router, TanStack Router, Vue Router, SvelteKit, Astro view transitions) count as pageviews on their own. No extra code is needed.

## Install with an AI code editor

Paste this prompt into Cursor, Claude Code, Windsurf or Copilot. The setup page in the dashboard has it with your site ID filled in.

```text title="prompt"
Install the DataOwl analytics script on my website (example.com).

Load this script on every page, inside <head>:

<script
  defer
  data-website-id="YOUR_SITE_ID"
  src="https://usedataowl.com/js/script.cookies.js"
></script>

- Next.js: use next/script in the root layout with strategy="afterInteractive" and keep the data-website-id attribute.
- Plain HTML or a static site generator: add the tag to the shared layout or head template.
- Don't add it twice, and don't bundle it: it must load from the src URL above.

Optional goal tracking: call window.datasense?.("signup", { plan: "pro" }) after key actions, or add data-ds-goal="checkout" to a button.

This is the cookie script: it sets first-party datasense_vid and datasense_sid cookies so returning visitors are recognized. If the site has a cookie consent banner, list them there as analytics cookies.

Optional, only if I ask for it: for signed-in users, call window.datasense?.("identify", user.id, { name, email }) once they're signed in, and window.datasense?.("reset") on sign-out.
```
