Getting Started

Get started in 2 minutes

Welcome to the Flowgrid docs. Drop in one script tag and you'll be capturing pageviews, sessions, performance, and conversions out of the box.

Introduction

Flowgrid is a tracking OS for product and web analytics. The fastest way to start is the hosted script — no build step, works on any site or CMS. Prefer a typed SDK? See the SDK Quickstart.

Let your AI assistant set it up

Copy this into Claude or ChatGPT, or the coding agent in your project. It never contains your Website ID or API key — the assistant wires them as environment variables and you paste the values in yourself. It installs the script, identifies signed-in users and connects your forms, and checks every step against these docs.

Open in Claude

Paste it into Claude Code in your project, or into claude.ai.

Set up Flowgrid analytics (https://flow-grid.xyz) on my website. If you can see my code (Claude Code, or a repo I've attached), make the changes; if not, tell me exactly what to paste and where.

My Flowgrid Website ID and API key: don't ask me for them, and never write them into code or into this chat.
- In a codebase, read them from public environment variables — NEXT_PUBLIC_FLOWGRID_WEB_ID and NEXT_PUBLIC_FLOWGRID_API_KEY (or the framework's own public prefix, e.g. VITE_FLOWGRID_WEB_ID). Add the names to the env example file and tell me which file to put the values in; I'll paste them myself from Flowgrid (Dashboard → my website).
- Where there is no codebase (a CMS head snippet), keep the placeholders YOUR_WEBSITE_ID and YOUR_API_KEY exactly as written and tell me where to replace them.

1. Find out what my website is built with (read package.json and the lockfile, or ask me which CMS) and tell me before changing anything.

2. Add the Flowgrid script once, on every page, inside <head>:
<script src="https://core.flow-grid.xyz/flowgrid.js" data-site="YOUR_WEBSITE_ID" data-api-key="YOUR_API_KEY"></script>
- Next.js: use next/script in the root layout with strategy="afterInteractive", the attributes read from the environment variables above.
- Vite apps (including Lovable and Bolt projects): index.html, inside <head>.
- WordPress, Webflow, Shopify, Framer: the site-wide custom code / head section.
Pageviews, sessions, page changes in single-page apps, Core Web Vitals, heatmaps and traffic sources are then tracked automatically. Don't add manual page-view calls.

3. If the website has sign-in, identify the signed-in user once the session is known:
window.flowgrid && window.flowgrid("identify", { user_id: user.id, email: user.email, name: user.name });

4. Forms (only if I give you a form ID from Flowgrid → Form events): add these to that <form> element:
data-form-namespace="THE_FORM_NAME" data-form-event-id="THE_FORM_ID"
THE_FORM_NAME is the form's name in Flowgrid, lowercase with hyphens: "Book a demo" becomes book-a-demo.
Flowgrid reads inputs named user_email, user_name, user_lastname and data_user_message as the lead's details; other named inputs arrive as extra answers. Rename an input only if the form's own code doesn't read it by that name. Never change what the form does when it is submitted.

5. Optional, for React or Next.js apps that want typed events or feature flags: npm install flowgrid-sdk, and see https://flow-grid.xyz/documentation/sdk for FlowgridProvider and FlowgridUser. The script from step 2 stays.

6. Tell me how to check it works: tracking is off on localhost by design, so deploy or open a preview URL, browse a page, and confirm requests to core.flow-grid.xyz in the browser's network tab and a live visitor in the Flowgrid dashboard.

Rules: use only the Flowgrid APIs above or in https://flow-grid.xyz/documentation — never guess a method name. Don't add or remove other analytics tools. Keep the change small and explain each edit.

Install the script

Create your website to grab your IDs, then add this tag to your site's <head>:

index.html
1<script 2 src="https://core.flow-grid.xyz/flowgrid.js" 3 data-site="YOUR_WEBSITE_ID" 4 data-api-key="YOUR_API_KEY" 5></script>

Replace your IDs

Swap YOUR_WEBSITE_ID and YOUR_API_KEY for the values from your dashboard. The script auto-instruments pageviews, SPA route changes, sessions, performance (Core Web Vitals), and attribution.

Installation Guides

Platform-specific walkthroughs for the most common stacks. Pick yours below:

Next steps

Once the script is live, start capturing what matters: track click events, form events, and goals, or go fully typed with the SDK.