~~~~ I've been using this extension for years successfully. Recently switched (per Google's demand) to GA4, replaced the tag accordingly in LocalSettings.php to the G-XXXXXXXX id provided, and....no data is collected. I've tried installing the latest extensions version, didn't help. Any idea what might be wrong? MW 1.30, PHP 7.1.33 MySQL 5.7
Extension talk:Google Analytics Integration/Archive 2
MediaWiki 1.30 has been out of support since 2019; your first step should be upgrading to a currently-supported version (you should probably aim for the current LTS version if you're not going to try and keep up with the latest stable release).
upgraded to MW 1.40. Still not working
notably by the way, GTag does work.
When I load this configuration in LocalSetting.php for extension Google Analytics:
wfLoadExtension( 'googleAnalytics' );
$wgGoogleAnalyticsAccount = 'GA4-xxxxxxxxxx';
I reload and the website has stopped to work.So I needed to comments line to restore.
And help?
Are there any plans to convert this extension to use the modern ExtensionRegistry mechanism?
I have a fork that does it (and a few other changes - see the README file): https://github.com/kolzchut/mediawiki-extensions-GoogleUniversalAnalytics
I guess I should merge my changes at same point, although we mostly use Google Tag Manager nowadays and this is mostly a legacy extension.
Do you have a link to the Google Tag Manager extension to which you are referring? I don't see one here and Extension:Google Tag Manager is archived.
I really should add it on here: https://github.com/kolzchut/mediawiki-extensions-GoogleTagManager
I just pushed an update to the extension - apparently I was using a custom hook for adding some HTML, which definitely wasn't going to work for general consumption.
Same question here. GA is moving towards a new generation of Google Analytics (Google Analytics 4). Is the current extension able to support GA4, and if not, will the extension at some point support GA4? Thanks, Albert.
Looks like the answer is still no. I ended up using Extension:GTag though it would be nice if this extension could add the G- tag for backwards compatibility in terms of not having to switch to an entirely new extension.
I've tired several different things. I can't find any mention of the special page in the article or on the archived talk page. What am I supposed to type to view the analytics page?
This extension just adds the Google Analytics tracking code (or any other service’s tracking code if you use the $wgGoogleAnalyticsOtherCode variable), it doesn’t add any frontend to view the data. If you use Google Analytics, you can check the data on analytics.google.com after logging into the Google account corresponding to your UA number.
Oh, that's unfortunate. Thank you for letting me know. My wiki was on Gamepedia for a time and they had a Special:Analytics page that allowed 'us' to view our web traffic, most searched terms, etc. I was hoping to add something similar, now that we're independent. The page made it seem like this was what we're after, since it talks about permissions for various user groups to see the analytics.
@Korra II Royal, it looks like they're using their own Hydralytics extension. I don't know whether it's possible to use on a standalone wiki - maybe @Alexia E. Smith knows?
Is there a wildcard selector for this extension, specifically for $wgGoogleAnalyticsIgnoreSpecials, I simply want to ignore all special pages without having to declare every single special page in the array.
If not $wgGoogleAnalyticsIgnoreSpecials = true; would be the optimal setting, if anyone could help me figure out how to do this either with the native extension or modification that would be awesome.
Google's Page Speed Insights recommended removing "Unused JavaScripts", namely the "OtherCode" tag. Is it necessary to use it with the $wgGoogleAnalyticsAccount tag, or can I remove it?
It also says that "Third-party code blocked the main thread", referring to the extension.
Hello! I notice the tutorial recommends the following LocalSettings syntax:
require_once "$IP/extensions/googleAnalytics/googleAnalytics.php";
Can I use the newer syntax to be consistent on my wiki?
wfLoadExtension( 'googleAnalytics' );
Thanks!
It doesn't look like this extension has been made compatible with the wfLoadExtension()
extension loader yet. If you think that conversion is something you might be up for, documentation on what's needed is at Manual:Extension registration#Migration for extension developers.
I started converting this extension, but the patch is awaiting review for more than two years now. :(
Thanks for the help @Dinoguy1000 and @Tacsipacsi!
I did install the extension using the require_once
format but unfortunately it doesn't seem to be working that way either.
I might give Extension:GTag a try to see if it works any better, but I'll stay tuned for updates on this one too. Thanks again for the info.
There are no older topics