React-ga: Warning message on firefox

Created on 19 Oct 2020  ·  5Comments  ·  Source: react-ga/react-ga

I am currently having a warning message on firefox:

Some cookies are misusing the recommended “SameSite“ attribute

Cookie “_ga” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Cookie “_gid” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Cookie “_gat” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

I disabled AdBlock but warning still show on the console.
how to fix this?

react ver: 16.13.1
react-ga ver: 3.2.0

edited: on chrome it was because of my avira browser safety, I disabled it and the error is gone but in firefox the warning message is still there.

Most helpful comment

Here's the fix:

ReactGA.initialize(trackingID, {
            gaOptions: {
                cookieFlags: 'SameSite=None;Secure'
            }
        });

Should probably be made the default in ReactGA

All 5 comments

Here's the fix:

ReactGA.initialize(trackingID, {
            gaOptions: {
                cookieFlags: 'SameSite=None;Secure'
            }
        });

Should probably be made the default in ReactGA

Thanks it's working, the message is gone now

@primal100 can you be more specific about where I can write this code? I'm having the same trouble @astroana

@primal100 can you be more specific about where I can write this code? I'm having the same trouble @astroana

in your Index.js file and replace the trackingID with your google tracking ID

@primal100 can you be more specific about where I can write this code? I'm having the same trouble @astroana

If you followed the readme procedure in ReactGA you should have a ReactGA.initialize line in your code. It's needed for ReactGA to work. You can add gaOptions in there as in my example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenjoe picture kenjoe  ·  4Comments

khmelevskii picture khmelevskii  ·  5Comments

nicolasiensen picture nicolasiensen  ·  7Comments

achhranitesh picture achhranitesh  ·  3Comments

amcinerneynewf picture amcinerneynewf  ·  4Comments