Jump to content

Extension talk:Google Analytics Integration

About this board

Previous discussion was archived at Extension talk:Google Analytics Integration/Archive on 2019-09-11.

109.186.159.48 (talkcontribs)

~~~~ 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

Dinoguy1000 (talkcontribs)

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).

85.64.147.60 (talkcontribs)

upgraded to MW 1.40. Still not working

85.64.147.60 (talkcontribs)

notably by the way, GTag does work.

Reply to "GA4 not working"

Help me w/ extension support GA4 tag

1
Souzaan (talkcontribs)

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?

Reply to "Help me w/ extension support GA4 tag"

Switching to ExtensionRegistry?

5
Justin C Lloyd (talkcontribs)

Are there any plans to convert this extension to use the modern ExtensionRegistry mechanism?

FreedomFighterSparrow (talkcontribs)
Justin C Lloyd (talkcontribs)
FreedomFighterSparrow (talkcontribs)
FreedomFighterSparrow (talkcontribs)

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.

Reply to "Switching to ExtensionRegistry?"

Does this extension support GA4 tags beginning with G- rather than UA-?

3
MyWikis-JeffreyWang (talkcontribs)
Albert Ke (talkcontribs)

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.

MyWikis-JeffreyWang (talkcontribs)

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.

Reply to "Does this extension support GA4 tags beginning with G- rather than UA-?"

What's the special page for this?

4
SungHerSong (talkcontribs)

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?

Tacsipacsi (talkcontribs)

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.

SungHerSong (talkcontribs)

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.

FreedomFighterSparrow (talkcontribs)
Reply to "What's the special page for this?"

Wildcard/Universal Selector for ignoring special pages.

1
Barmaley bl (talkcontribs)

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.

Reply to "Wildcard/Universal Selector for ignoring special pages."
109.250.111.54 (talkcontribs)

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?

109.250.111.54 (talkcontribs)

It also says that "Third-party code blocked the main thread", referring to the extension.

Reply to "Unused JavaScripts"

Updated LocalSettings syntax?

4
Summary by Tacsipacsi
Knomanii (talkcontribs)

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!

Dinoguy1000 (talkcontribs)
Tacsipacsi (talkcontribs)
Knomanii (talkcontribs)

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.

Reply to "Updated LocalSettings syntax?"
There are no older topics