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

Allow to disable PageView event per default for tiktok and facebook pixel #81

Open redasalmi opened 2 years ago

redasalmi commented 2 years ago

Is your feature request related to a problem? Please describe. Is there any particular reason to trigger the window.fbq('track', 'PageView') event inside of the trackTikTokPixel function ?

https://github.com/andrezimpel/gatsby-plugin-gdpr-cookies/blob/02ce0e6aed6277b34041c6f9ca662ec26abad752/src/services/tiktok.js#L35-L44

Describe the solution you'd like It would be really helpful to have a way to opt out of the PageView event for the tiktok tracker or in general, like a pageViewDisable bool field inside of gatsby-config.js for the facebookPixel and tikTokPixel objects.

Additional context My problem is that I wanted to add the eventID param to the PageView event for facebook pixel, after adding it manually (I had to opt out of the gatsby-gdpr-facebook-pixel and install fbevent.js manually because there is no way of doing it with this package), I got a warning that the event is getting duplicated and found out it was getting triggered by the trackTikTokPixel.