Google Analytics stopped collecting data from the extension


We had been successfully using Google Analytics for over a year. Suddenly, we noticed that starting from July all the numbers dropped heavily, and we know it’s not reflecting real situation. We started to test our extension, and it turned out our extension stoped sending data to google analytics, even thought it’s correctly set up. The same code does send analytics when running in developer rig.
We believe twitch started to block google analytics request for most of the users. To confirm that, we checked the official documentation:

… and created extension based on a code from it. You can find it here:

We tested the above code and again - it does work when open in Developer Rig, it works if we open it directly in the browser, but when accessing it via, it’s not sending /collect requests to google analytics.

Please use the github code and test it yourself. If it’s somehow an issue on my side, let me know - all the help is very welcomed.

Thanks in advance,


You probably need to revise your analytics code in your extension to resolve

Hey Barry,

Thanks for immediate response, its crazy you are able to answer within a minute after my question lands.
I’ll check it soon. I’m just wondering how is it possible that official example is not reflecting that.

I’ll post the solution here if it works.


Docs probably not been updated to account for the changes, since no one has thought to raise a docs update request based on changes to GA. And GA can change on a dime half the time.

Edit: Filed as 277 Google Analytics in extensions: example not up to date with GA changes · Issue #277 · twitchdev/issues · GitHub

And I was quick since I still had the tab open from when it was discussed in the Dev Discord recently.

I confirm adding cookieFlags: 'max-age=7200;secure;samesite=none' solved the issue. Once again, thank you for your help Barry.

Thanks for rising the issue on github as well. I know where to report it next time.