gatsby-plugin-gdpr-cookies

Gatsby plugin to add Google Analytics (V4 is supported), Google Tag Manager, Facebook Pixel, TikTok Pixel and Hotjar in a GDPR form to your site.

github.com/andrezimpel/gatsby-plugin-gdpr-cook…
gatsby-plugin-gdpr-cookies homepage screenshot

About gatsby-plugin-gdpr-cookies

gatsby-plugin-gdpr-cookies is a Gatsby plugin for adding Google Analytics (including V4), Google Tag Manager, Facebook Pixel, TikTok Pixel, Hotjar and LinkedIn tracking. It adds the tracking code to the site but does not initialize the trackers or send data until the corresponding consent cookie is set to true.

Trackers are configured in gatsby-config.js with IDs, custom cookie names, and environments, with options such as IP anonymization for Analytics. The site owner must provide cookie handling that sets each tracker cookie to true or false; page views are then tracked on route changes without requiring a reload.

Key features

  • Adds Google Analytics, including V4, gated by consent cookie
  • Adds Google Tag Manager with configurable data layer name
  • Adds Facebook Pixel, TikTok Pixel and LinkedIn tracking via cookies
  • Adds Hotjar using Hotjar ID and snippet version
  • Supports custom cookie names for each tracker
  • Supports IP anonymization and ad-features options for Analytics
Best for: Gatsby developers who need to add multiple analytics and pixel trackers behind cookie consent.
Good for
  • Withholds tracker initialization and data sending until consent cookies are set to true
  • Checks consent between route changes, so no reload is needed after consent
  • Allows custom cookie names and environment-specific tracking
Watch out for
  • Requires the site owner to implement consent handling that sets each tracker cookie

gatsby-plugin-gdpr-cookies at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

gatsby-plugin-gdpr-cookies alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

funnel

github.com/sunwjy/funnel

Unified marketing funnel event tracking — one GA4-standard track() call dispatches to GA4, Meta Pixel, TikTok, Kakao, and 14+ analytics platforms

Open source
24 alternatives

Popular in TikTok Tools

Well-known listings from the same topic.

All 68

gatsby-plugin-gdpr-cookies FAQ

Does the plugin send data before consent is given?
No. It adds the tracking code without activating it, and no data is sent before the relevant cookies are set to true and the plugin is initialized.
Is a page reload needed after a visitor accepts cookies?
No. The plugin checks the consent cookies on route update and tracks page views then.
How do I disable a specific tracker?
Leave its tracking ID or pixel ID empty in the plugin options.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing