ActionLab Analytics for Gatsby

Add privacy-first, AI-powered analytics to your Gatsby site in under 60 seconds. No cookies, no consent banners, no complex setup.

Installation Code

Gatsby
// gatsby-ssr.js
export const onRenderBody = ({ setHeadComponents }) => {
  setHeadComponents([
    <script
      key="actionlab"
      src="https://cdn.actionlabanalytics.com/actionlab.js"
      data-site="YOUR_SITE_ID"
      defer
    />,
  ]);
};

Step-by-Step Setup

  1. 1

    Create or open your gatsby-ssr.js file.

  2. 2

    Use onRenderBody to inject the ActionLab script into the <head>.

  3. 3

    Replace YOUR_SITE_ID with your actual site ID.

  4. 4

    Gatsby client-side navigation is tracked automatically.

Why Use ActionLab with Gatsby

  • Proper SSR injection via gatsby-ssr.js
  • Gatsby Link navigation tracked automatically
  • Works with Gatsby Cloud and Netlify hosting
  • No Gatsby plugin needed

Frequently Asked Questions

Is there a Gatsby plugin for ActionLab?

No plugin is needed. Adding the script via gatsby-ssr.js is the recommended approach and works with all Gatsby versions.