Thanks to Ritesh Kadmawala for building this!
GitHub: posthog/gatsby-plugin-posthog
Gatsby behaves like a single-page app which means to track $pageview events special care is needed. This integration takes care of that.
Install
or
How to use
This will automatically start tracking pageviews, clicks and more.
In your code you can access posthog via window.posthog.
For more instructions, see browser JS library.