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

i see no difference before consent and after .. #30

Closed ahmadkhalaf1 closed 3 years ago

ahmadkhalaf1 commented 3 years ago

so after adding the config below , and adding the cookie value true or false , nothing really change , i can see that gtm is always loaded in my network even without consent , datalayer is also available , and data are passed to my GTM . i am using react-cookie-consent to set gatsby-gdpr-google-tagmanager true what am i doing wrong? i doubled check my cookie name is the same as the one in my browser.

Thanks


    {
      resolve: `gatsby-plugin-gdpr-cookies`,
      options: {
        googleTagManager: {
          trackingId: process.env.GTM_PROPERTY, // leave empty if you want to disable the tracker
          cookieName: 'gatsby-gdpr-google-tagmanager', // // here can you change the cookie name
          dataLayerName: 'dataLayer', // default
        },
        environments: ['production', 'development'],
      },
    },
andrezimpel commented 3 years ago

Dear @ahmadkhalaf1

thank you for the feedback. So basically GTM is working without giving the consent, right? I gotta have a look at this.

ahmadkhalaf1 commented 3 years ago

Thanks for your reply:) so basically only gatsbyRouteChange event is working after consent, but beside this I have some other dataLayer events , click events , scrolling , all these are passed to GTM without consent .

On Wed, Dec 2, 2020, 8:18 AM Andre Zimpel notifications@github.com wrote:

Dear @ahmadkhalaf1 https://github.com/ahmadkhalaf1

thank you for the feedback. So basically GTM is working without giving the consent, right? I gotta have a look at this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andrezimpel/gatsby-plugin-gdpr-cookies/issues/30#issuecomment-737044378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMXYIDK6CMGU4CXWKMPDGDSSXS5ZANCNFSM4UI6RNQQ .

andrezimpel commented 3 years ago

I‘m actually not using the tag manager for my projects. Would you mind doing a short screensharing session so I can see what’s going on? I might overhaul the tag manager integration and use the react-gtm package.

Sent from my iPhone

On 2. Dec 2020, at 09:58, ahmadkhalaf1 notifications@github.com wrote:

 Thanks for your reply:) so basically only gatsbyRouteChange event is working after consent, but beside this I have some other dataLayer events , click events , scrolling , all these are passed to GTM without consent .

On Wed, Dec 2, 2020, 8:18 AM Andre Zimpel notifications@github.com wrote:

Dear @ahmadkhalaf1 https://github.com/ahmadkhalaf1

thank you for the feedback. So basically GTM is working without giving the consent, right? I gotta have a look at this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andrezimpel/gatsby-plugin-gdpr-cookies/issues/30#issuecomment-737044378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMXYIDK6CMGU4CXWKMPDGDSSXS5ZANCNFSM4UI6RNQQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

ahmadkhalaf1 commented 3 years ago

I‘m actually not using the tag manager for my projects. Would you mind doing a short screensharing session so I can see what’s going on? I might overhaul the tag manager integration and use the react-gtm package. Sent from my iPhone On 2. Dec 2020, at 09:58, ahmadkhalaf1 @.> wrote:  Thanks for your reply:) so basically only gatsbyRouteChange event is working after consent, but beside this I have some other dataLayer events , click events , scrolling , all these are passed to GTM without consent . On Wed, Dec 2, 2020, 8:18 AM Andre Zimpel @.> wrote: > Dear @ahmadkhalaf1 https://github.com/ahmadkhalaf1 > > thank you for the feedback. So basically GTM is working without giving the > consent, right? I gotta have a look at this. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <#30 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AEMXYIDK6CMGU4CXWKMPDGDSSXS5ZANCNFSM4UI6RNQQ > . > — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

sorry for late reply , sure we can have a zoom meeting and i can show you what i mean , because i also discovered a new issue related to the cookie , the cookie is removed from the browser if we close the tab , this mean that every time user close the tab and browser and open it again he will see the consent popup which is annoying , i dont know if thats how it meant to be or i am doing something wrong .

please let me know when its suitable for you to have our short call , tomorrow is a proposal from my side :)

thanks

andrezimpel commented 3 years ago

Hey @ahmadkhalaf1 sorry for getting back late. Could you send me an email to andre@unknownbasics.com so we can find a time for a call asap?

panszczypior commented 3 years ago

@andrezimpel same happened to me, I mean it starts to track even the user hasn't clicked decline or accept consent. No matter which option is selected and by saying that I mean setting the value of the cookie to false or true user is still tracked. On the opposite site to the OP I'm using google-analytics.

EDIT: It's working ! Turned out I didn't delete the other one plugin for GA.

jenkin commented 3 years ago

@andrezimpel I have the same problem of @ahmadkhalaf1 : ga and fb work very well (without true cookies they don't set cookies or fire tracking requests), but gtm ignores settings, sets its cookies and fires events.

I think the problem is in this fragment inside the official gtm code snippet: w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});. This event is fired regardless the user choice.

Here you can find a fix proposal that works for me (only gtm active): https://github.com/Dataninja/gatsby-plugin-gdpr-cookies/tree/hotfix/issue-30.

andrezimpel commented 3 years ago

@jenkin got you. Thanks for the support. I am having a look at this right now. I had actually the same issue with GA4 which I was finally able to solve.

jenkin commented 3 years ago

@andrezimpel have you any news?

andrezimpel commented 3 years ago

@jenkin Sorry, I missed your last comment. I am about to finish 2.0 which is a complete rewrite. Nothing is every sent do Google or Facebook before the cookie es set and the plugin is initialized. Would you mind testing 2.0 out?

andrezimpel commented 3 years ago

@panszczypior do you only have the trigger for the plugin in Tag Manager as described in the ReadMe or do you include all events?

jenkin commented 3 years ago

Sorry @andrezimpel but also the latest version doesn't seem to work (see screenshot, the cookie bar is open, there is no cookie from this plugin, but facebook and ga start to tracking without problems).

I have to wait for next v2? Have you take a look to my proposed fix?

My gatsby config.

{
  resolve: 'gatsby-plugin-gdpr-cookies',
  options: {
    googleTagManager: {
      cookieName: 'gdpr-consent',
      trackingId: process.env.GOOGLE_TAG_MANAGER || ''
    },
    environments: ['production']
  }
}

Screenshot_20210317_173407

andrezimpel commented 3 years ago

@jenkin yes this is know for version 1. Just finishing up V2 as of writing this comment. Gonna publish it right now. It should resolve the issue.

jenkin commented 3 years ago

@andrezimpel finally I implemented v2 and now all works fine, thanks!

andrezimpel commented 3 years ago

@jenkin So this issue should be solved, right?

jenkin commented 3 years ago

Yes!