How to use Panelbear with Gatsby

Once you have added your website to Panelbear, all that is left to do is integrate our analytics snippet.

It's a small piece of code that runs on your website, and it collect the metrics necessary to show you the insights in the dashboard. For more information on what it collects check out What do we collect?.


To install Panelbear on your Gatsby project all you have to do is drop the analytics snippet for your website into the <head> section of your HTML document.

  1. Open a terminal on your Gatsby project's root directory.
  2. Run cp .cache/default-html.js src/html.js.
  3. Paste your Panelbear analytics snippet into the <head> section of the HTML code.

Check out the Gatsby documentation for adding custom HTML for more information on this method.

Check your installation

After you have added our analytics script to the HTML of your website, you should be able to see pageviews show up in the dashboard within a minute of the visitors coming in to your website.

If you need help, you can reach out to us at [email protected].

Tip: Check out our local development guide for some tips and tricks when testing Panelbear on your machine.

Better products need better tools

Free plan available - no credit card required.

Sign up for freearrow_forward