Skip to main content

All Questions

1 vote
1 answer
2k views

How to Add multiple Tracking ID for Google Analytics in Gatsby.js?

I used gatsby-plugin-google-gtag earlier in my gatsby project to add 2 Google Analytics tracking ID and it was working fine but unfortunately, my project already has gatsby-plugin-google-analytics ...
Akii J's user avatar
  • 127
1 vote
1 answer
641 views

react cookie consent not registering on first site visit

I have a react gatsby site and I'm using the gatsby-plugin-gdpr-cookies plugin. This is in my gatsby-config: { resolve: "gatsby-plugin-gdpr-cookies", options: { googleAnalytics: { ...
yankeedoodle's user avatar
0 votes
1 answer
486 views

How to insert a google anylitics tag inside of a gatsby js file?

Trying figuring out how to place google-analytics tag in side of js file of Gatsby. There's a gatsby-plugin-analytics plugin , but an example shown there didn't give an idea to place the google ...
Askar's user avatar
  • 5,854
0 votes
2 answers
2k views

React (Gatsby) deactivate Google Analytics in TypeScript

How to create a deactive Goole Analytics link in Gatsby.JS? My link doesn't deactivate Google Analytics. Used plugins: https://www.gatsbyjs.org/packages/gatsby-plugin-gdpr-cookies/ https://www....
Sarah Pöhler's user avatar
22 votes
3 answers
14k views

How set up a Gatsby Cookie consent banner with gatsby-plugin-gdpr-cookies

My website gathers information for Google Analytics, so I need to include a Cookie consent banner for the users to opt in/out of. I saw the plugin gatsby-plugin-gdpr-cookies and thought it looked ...
James Brightman's user avatar
1 vote
2 answers
5k views

Trying to figure out how to implement cookies in Gatsby.js and somehow manage them with the new GDPR law

I've tested implemented cookie hub, react-ga, gatsbu plugin-gdpr cookies. Nothing special happends when I configure them, I can't even see any cookies inside devtools. Has anyone come up with how to ...
Mrjoes's user avatar
  • 25
0 votes
1 answer
821 views

Find Google Analytics object in window in conjunction with gatsby-plugin-google-analytics

I'm trying to set up event tracking with Google Analytics. I am using Gatsby and gatsby-plugin-google-analytics in my gatsby-config.js to produce this Google Analytics snippet in the head of my ...
David Gaskin's user avatar
2 votes
0 answers
335 views

How to add an event handler to a button in a third party form component

I've got a Gatsby site that uses a handful of plugins and third-party components. The component in question is a form built with react-hubspot-form. Hubspot sends raw HTML which I'm able to style with ...
Chris DeSilva's user avatar
9 votes
2 answers
2k views

Scroll depth GTM - Gatsby

I have a problem with running of gatsby based pages with GTM scroll depth. The problem is that the gtm scroll depth isn't compatible with SPA and doesn't reset when moving to the next page. Does ...
Michał Styś's user avatar
9 votes
1 answer
7k views

Multiple installations of Global site tag (gtag.js) detected in Gatsby application

I have Google Analytics code set up in my gatsby application. <script> var gaId = "UA-xxxxxxxx-1"; var JSLink = "https://www.googletagmanager.com/gtag/js?id=" + gaId; var JSElement =...
Tamn's user avatar
  • 157
7 votes
3 answers
5k views

Gatsbyjs + Google analytics - tracking custom events?

Is it somehow possible to track custom events with gatsby and google analytics?
AAverin's user avatar
  • 3,042
4 votes
1 answer
2k views

Gatsby.js: gatsby-plugin-google-analytics only firing events in production build

I'm using the gatsby.js plugin gatsby-plugin-google-analytics (version 1.0.31), and it only places my tracking code on my site when I run gatsby build. In that case, my tracking and click events work ...
Bonnie's user avatar
  • 621
4 votes
5 answers
13k views

Facebook pixel in Gatsby js/ React js

I've recently developed site using gatsbyjs and I want to use a facebook conversion pixel on the site(as well as Google analytics). I need ideas or help to make them work so I can run a conversion ...
Aiman Farhan's user avatar