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)
What does exist is the Extensions Analytics you can find here:
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!