Installation library

Website analytics, installed properly.

Add DataSag to your website with one public tracking key. Choose your platform for the right installation location, then check that real visits reach your project.

Choose your platform

  • Next.js App Router

    app/layout.tsx, inside the root body

    Setup + 9 practical checks

  • Next.js Pages Router

    pages/_app.tsx, alongside the page component

    Setup + 9 practical checks

  • React with Vite

    the head of the root index.html

    Setup + 9 practical checks

  • Astro

    the head of your shared .astro layout

    Setup + 9 practical checks

  • SvelteKit

    the head of src/app.html

    Setup + 9 practical checks

  • Nuxt

    the app head configuration in nuxt.config.ts

    Setup + 9 practical checks

  • WordPress

    a site-wide head injection or the wp_head hook

    Setup + 9 practical checks

  • Webflow

    site-wide head custom code

    Setup + 9 practical checks

  • Framer

    site settings custom code for the head

    Setup + 9 practical checks

  • Shopify storefront themes

    layout/theme.liquid before the closing head tag

    Setup + 9 practical checks

  • Squarespace

    site-wide Header code injection

    Setup + 9 practical checks

  • HTML websites

    the head of every HTML document or shared template

    Setup + 9 practical checks

  • Laravel Blade

    the head of the shared Blade layout used by your web routes

    Setup + 9 practical checks

  • Django templates

    the head of the inherited base template

    Setup + 9 practical checks

  • Flask with Jinja

    the head of the Jinja base template used by your routes

    Setup + 9 practical checks

  • Ruby on Rails

    the head of the applicable ERB application layout

    Setup + 9 practical checks

  • Express with EJS

    a shared EJS head partial included by the intended page templates

    Setup + 9 practical checks

  • Remix v2

    the head of the existing document in app/root.tsx

    Setup + 9 practical checks

  • Angular

    the head of the application index document selected by the build configuration

    Setup + 9 practical checks

  • Vue with Vite

    the head of the Vite application root index.html

    Setup + 9 practical checks

  • Standalone Blazor WebAssembly

    the host document wwwroot/index.html in a standalone WebAssembly app

    Setup + 9 practical checks

  • PHP templates

    the head emitted by the shared PHP header include

    Setup + 9 practical checks

  • Gatsby

    an onRenderBody head component in the root gatsby-ssr.js file

    Setup + 9 practical checks

  • Hugo

    the shared HTML head partial or base template used by the theme

    Setup + 9 practical checks

  • Ghost

    the site-wide Site Header code injection field

    Setup + 9 practical checks

  • Carrd

    a Code Embed with Hidden style and Head location

    Setup + 9 practical checks

  • Docusaurus

    the scripts array in docusaurus.config.js or docusaurus.config.ts

    Setup + 9 practical checks

  • VitePress

    the head array in .vitepress/config.ts or its configured equivalent

    Setup + 9 practical checks

  • Material for MkDocs

    an extrahead block in a theme override

    Setup + 9 practical checks

  • Jekyll

    the head of the shared _layouts/default.html or its head include

    Setup + 9 practical checks

  • Eleventy

    the head of the shared layout resolved from your includes directory

    Setup + 9 practical checks

  • Hexo

    the head of the active theme layout or its shared head partial

    Setup + 9 practical checks

  • Pelican

    the head of the active theme templates/base.html

    Setup + 9 practical checks

  • Grav 1.7 Twig themes

    the head in the active theme templates/partials/base.html.twig

    Setup + 9 practical checks

  • Drupal Twig themes

    the head in your custom theme html.html.twig override

    Setup + 9 practical checks

Common setup checks

What every installation should prove

One tracker on each intended page. The correct project key. A successful pageview request. A matching visit in your dashboard. Each platform guide covers these checks, plus events, campaigns, AI referrals, CSP and internal traffic exclusions.

For search performance and answer citations, read the LLMEO and AI visibility guide. Website traffic and AI answers are different measurements.