segmentio / consent-manager

Drop-in consent management plugin for analytics.js
https://segmentio.github.io/consent-manager/
MIT License
341 stars 144 forks source link

Page Constantly Reloads using Gatsby and Consent manager #260

Closed blackbeak closed 1 year ago

blackbeak commented 2 years ago

https://github.com/segmentio/consent-manager/issues/10

The above issue sounds very similar to what happens when I add the consent manager to my Gatsby layout page. Just a constant refresh after loading the page. After reading through the thread I couldn't work out a way to de-bug this.

I am using the Gatsby/Segment plugin which injects the code into the header of each page (where Analytics.js is called) so I am not sure on the best practice to remove analyticsload(). I am not using the physical script anywhere.

edsonjab commented 2 years ago

Hi @blackbeak thanks for your report, we start looking into this

blackbeak commented 2 years ago

Hi @blackbeak thanks for your report, we start looking into this

Thanks. Any pointers in the right direction would be great.

FloHiwg commented 2 years ago

Hi @blackbeak,

I implemented it yesterday on our side. I had trouble since I didn't remove the analytics.load() from the snippet. I set up my own component including the Consent Manager component and the Script component from Gatsby with the Snippet. I wasn't able to implement it with one of the few Gatsby plugins.

I can provide you with a version of this component if this helps.

blackbeak commented 2 years ago

That would be great. I still don't have a working solution as the sites I'm working aren't live yet so I am coming back to this later, but it would be great to see if I could add it to my deployment.

blackbeak commented 2 years ago

Did anyone get any further forward on this? I want to use the app but it's currently not fit for use with Gatsby.

edsonjab commented 1 year ago

Hi @blackbeak sorry for the delay, I created an example how can use gatsby with consent-manager, if is totally different to your solution please put the specifications for your project to replicate the issue please.