andrezimpel / 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.
Apache License 2.0
101 stars 70 forks source link

Facebook Pixel Support #18

Closed danny-waite closed 4 years ago

danny-waite commented 4 years ago

Hi guys, been on a bit of a wild goose chase trying to get Facebook Pixel up and running, I'm probably doing something silly...

First up, I don't see a banner, initially I took it that I need to implement that myself and simply set gatsby-gdpr-facebook-pixel once the user accepts. So I decided to use react-cookie-consent and set this cookie on the onAccept event, works to a point but I need to refresh the page for the pixel to load so I tried to send a window.fbq("consent", "grant") but no luck.

So looking through the issues, I see that I should see a banner, I don't, but the further question would be, can I change the appearance of this banner? I can't see anything in the docs/code. https://github.com/andrezimpel/gatsby-plugin-gdpr-cookies/issues/4#issuecomment-583735299

So if I was to use react-cookie-consent to implement the banner, how would I initialise the pixel on accept?

Hope that all makes sense.

andrezimpel commented 4 years ago

Dear Danny

I actually started working on this right now. I'm adjusting the plugin so people can also add their own/custom scripts plus I'm adding a consent banner which will then use all the scripts in the gatsby config.

danny-waite commented 4 years ago

ah ok great, thanks for the heads up Andre, let me know if I can help in any way, happy to test and provide feedback

danny-waite commented 4 years ago

Just wondered how you were getting on with this Andre? I'm about to push a site live so need to come up with a solution :)