-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Analytics in Extensions - July 2023 deadline #689
Comments
|
Ticket for tracking internally: ANC-3118. |
|
While there isn't an exact date to provide for the Extensions CSP to be updated, the team is looking to prioritize this addition for early 2023 to give developers plenty of time for review submissions before Google's deadline. |
|
Hey, do you guys have new updates on this? Thanks in advance. |
|
@luisvinicius09 This is now actively being worked on, so we should have an update soon for this ticket. |
|
Any updates on this? The CSP has been updated and everything is working as expected in my hosted test, but my extension review is currently stuck in a pending state. Any ideas? Extension client ID: tdldrg6rlw5eewiwcpxo3dv0obyckc |
|
Extension review issues are between you and extension review, if it's pending you should of got an email from extension review with issues. Or you are stuck due to the layoffs. Either way the bug tracker can't help you here, you need to contact the extension review team Since for all we know as not the review team is that you have been blocked over something else (ie not google analytics) |
|
any updates on this? the deadline is just 3 days away |
|
Yes. The CSP was updated. my notes follow: In your view HTML(s), before closing head tag </head>add, generally immediately after your Extension Helper JS Script include <script async src="https://www.googletagmanager.com/gtag/js?id=GCODE"></script>
Then in an external javascript file window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GCODE');
for additional GDPR-ness window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GCODE', { 'anonymize_ip': true, 'cookie_flags': 'max-age=7200;secure;samesite=none' });
[note 1] GCODE being the
|
|
@BarryCarlyon @jbulava There are minor differences to your notes like I do not use an external js file but directly declare another script tag after the first one. Also I use https://github.com/PriceRunner/react-ga4 due to migration. But as I said, locally everything works as expected.
Could you please state clear if things should work in hosted test and if the mentioned changes are live already? |
|
It's working for for me in production/released extension
The debugger may not connect properly as it doesn't percolate the extra query parameter down to the nested iframe stack so the debugger doesn't connect
You now have duplicate rules, this issue states the text above the box describing the default rules hasn't been updated to include the new defaults, the bit that starts "included by default" has not been updated to include the new rules that are added by default, see: https://dev.twitch.tv/docs/extensions/life-cycle/#asset-hosting was updated but the corresponding decsriptive text on the dev console has not which is what 755 pertains to. (The blue boxes indicate the issue is with the help text on the page) So at the moment you have declared the same rule twice.
You are not logging a CSP error in the console, Therefore the issue is not CSP or Twitch, it's between you and GA4, GA4 can choose not to send events for a varierty of issues it seems.
Do you mean You cannot use "inline JS" and that would cause a permissions error to debug in the console By
I mean do not use inline JS like the Google Analytics documentation generally suggests As for your extension all Javascript must be in an external file, as inline Javascript is not allowed. |
|
Thank you very much for your explanations and support. There was one tiny detail missing: window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GCODE', { cookie_flags: 'max-age=7200;secure;samesite=none' }); |
|
Good spot I'll add cookie_flags to my notes and next extension release(s)! |

Brief description
June 2023 will see the end of Google Analytics supporting Universal Analytics
Requiring users to move to Google Analytics 4
This is on a different domain to current. So the CSP requires modification.
Initially this seems to require allowing
scriptandconnectrules to includehttps://www.googletagmanager.com/https://*.google-analytics.com/Additional context or questions
Filing as a bug (github) rather than a feature request (uservoice) as if CSP not fixed in time, there will be a flood of Extensions into the queue for the revision and/or removal of GA for something else if Twitch doesn't support new Google Analytics
https://support.google.com/analytics/answer/11583528?hl=en
The text was updated successfully, but these errors were encountered: