RankFloRankFlo

Analytics Setup

RankFlo includes built-in, cookieless analytics — no GDPR consent banner needed. One line of JavaScript gives you pageviews, traffic sources, device breakdown, country detection, AI referrer tracking, and custom events.


Install the tracker

Add this script tag to your website's <head> or before </body>:

html
<script
  async
  src="https://app.rankflo.io/tracker.js"
  data-project-key="blg_YOUR_PROJECT_KEY"
></script>

Replace blg_YOUR_PROJECT_KEY with your project API key from Dashboard → Projects → your project.

For self-hosted instances, replace app.rankflo.io with your own domain.

Next.js

typescript
// app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Script
          src="https://app.rankflo.io/tracker.js"
          data-project-key="blg_YOUR_PROJECT_KEY"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

Astro

html
<!-- src/layouts/Layout.astro -->
<html>
  <body>
    <slot />
    <script
      src="https://app.rankflo.io/tracker.js"
      data-project-key="blg_YOUR_PROJECT_KEY"
      async
    ></script>
  </body>
</html>

Plain HTML

html
<!-- Add before </body> -->
<script
  src="https://app.rankflo.io/tracker.js"
  data-project-key="blg_YOUR_PROJECT_KEY"
  async
></script>

What it tracks

The tracker automatically captures:

Data pointHow
Page viewsEvery page load and SPA navigation
Unique visitorsAnonymous ID stored in localStorage (not a cookie)
SessionsSession ID in sessionStorage, resets on tab close
Referrerdocument.referrer — where the visitor came from
Device typeDesktop, mobile, or tablet (from screen width)
BrowserDetected server-side from User-Agent
Operating systemDetected server-side from User-Agent
CountryIP geolocation (server-side, IP not stored)
UTM parametersutm_source, utm_medium, utm_campaign, utm_term, utm_content
Session durationTime between first and last event in a session
Languagenavigator.language

No cookies, no IP storage, no fingerprinting. The tracker uses localStorage for visitor IDs and sessionStorage for session IDs. Your visitor's IP is used server-side for country detection but is never stored in the database.


AI referrer tracking

RankFlo automatically detects traffic from AI platforms and shows them separately in the AI Referrers section of your analytics dashboard:

PlatformReferrer domain
ChatGPTchat.openai.com, chatgpt.com
Perplexityperplexity.ai
Claudeclaude.ai
Google Geminigemini.google.com
Microsoft Copilotcopilot.microsoft.com
Grokgrok.com
You.comyou.com
Phindphind.com
Poepoe.com

No setup needed — if a visitor arrives from any of these platforms, it appears in your AI Referrers panel automatically.


Custom events

Track signups, button clicks, and other conversion events:

javascript
// Track a custom event
window.rankflo.track("signup", { plan: "pro" });

// Track a button click
document.getElementById("cta").addEventListener("click", () => {
  window.rankflo.track("cta_click", { location: "hero" });
});

Custom events appear in your analytics dashboard alongside pageviews.


SPA support

The tracker automatically detects client-side navigation (Next.js, Remix, Astro with view transitions) by listening for history.pushState and popstate events. No additional configuration needed.


Viewing analytics

Go to Analytics in the sidebar. You'll see:

  • Overview — page views, unique visitors, sessions, engagement metrics
  • Posts — top performing content with view counts
  • Sources — referrers, AI referrers, UTM breakdown
  • Locations — visitor countries

Use the date range picker (7d, 30d, 90d, 1yr) and project filter to narrow down the data.

The tracking snippet button at the top of the analytics page shows your project key and a ready-to-copy code snippet.


Self-hosted configuration

When self-hosting RankFlo, the tracker script is served from your own domain. Update the script URL to point to your instance:

html
<script
  async
  src="https://your-rankflo-domain.com/tracker.js"
  data-project-key="blg_YOUR_PROJECT_KEY"
></script>

All analytics data stays on your server — nothing is sent to third parties (except the optional IP geolocation lookup for country detection).