For quite some time we were investigating possible ways to understand our viewers needs better. We really would like to learn more about them, i.e. the number of unique viewers, their age, citizenship etc. I know that twitch exposes analytics, which is a good first step but it’s not sufficient for us.
The obvious soluition would be to add google analytics. I’ve searched the forum to check if anyone was able to add GA to his extension, but unfortunately, i didn’t get a clear answer. Let’s make it clear once and for all: is it allowed to add GA integration into the overlay extension?
In case if GA is illegal, are there any solutions that are legal from the Twitch policy perspective?
Adding GA is essentially not possible. As it would need to set a Cookie and you can’t/shouldn’t set cookies. (Cookies are blocked iirc but I think localstorage is allowed not sure/can’t confirm off hand)
Further more it would be a nightmare from the security and privacy policy perspective. Due to the fact Twitch would technically need to make changes to it’s privacy policy in order to allow third party GA in an extension and fun with opt’ing etc. (Especially in a GDPR world)
What does exist is the Extensions Analytics you can find here:
But afaik Twitch’s Privacy Policy as per GDPR doesn’t include a message saying “we pass data to a third party via a third party”.
Further more:
Given that the Twitch Extensions code is hosted of Twitch’s servers too, and most, if not all Analytics programs contain obstifcated code, thats also not allowed in a twitch extension and you can’t include offsite libraries due to the CSP in place. (Which includes code.jquery.com too for example) So you can’t include include the script tags as the load attempt will be blocked.
So, before you even consider that you want to inject analytics into someone else’s website, without permission from the user (yay ethics). You just can’t do it anyway due to the security restrictions in place. (yay rules).
OH and not forgetting if your extension supports mobile, theres a pile of rules about over the wire limits, AND recent builds of safari (desktop) have done something weird with permissions in iframes across domains (some Shopify applications are TOTALLY hosed right now).
TLDR: You can’t do it Legally speaking (GDPR) and you can’t do it as it’s against the Extension rules.
I suppose Tracking Pixels might function, but that might violate GDPR.
I’ll read the Guidelines for sure. FYI Mixpanel has a nodejs plugin without any code obfuscation so it works fine technically. I also checked the Twitch Analytics and Insights - I’m sure its all new but its a long long long way away from being a professional product right now - it’s extremely difficult to construct funnels and do analysis on user behaviour in order to remove kinks in the user experience. Developing a product blindly in this day and age is extremely frustrating!
One of my top feedback to the Analytics team is “funnels please!”
Right now you can run your own funnels and transmit data back to your EBS and monitor that way, you just can’t punt it offsite to a third party analytics
Sorry to dig out this very old thread again, but this is still the top result when searching for “Twitch Extension Google Analytics”, so I thought it would be useful for future reference.