WordPress.org

Making WordPress.org

Opened 3 years ago

Last modified 23 months ago

#1017 new defect

Google Analytics code uses old (deprecated format)

Reported by: slobodanmanic Owned by:
Milestone: Priority: normal
Component: General Keywords:
Cc:

Description

Just noticed WordPress.org uses old Google Analytics code (ga.js). While it still does work, even though most (all?) Google Analytics accounts are already converted to Universal Analytics, it will be deprecated and stop tracking.

How to upgrade:
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

Upgrade timeline:
https://developers.google.com/analytics/devguides/collection/upgrade/

Change History (8)

#1 @obenland
3 years ago

When updating it, keep in mind to search for uses like in the theme directory, where the JS app uses it to log subsequent page views.

#2 @slobodanmanic
3 years ago

Thanks @obeland, I wasn't aware I could contribute to this as well (thought it was limited to WP core).

I checked in #meta channel on Slack, and @deconf told me some GA properties are converted to Universal Analytics, and others were not. No idea for me to check which ones are, because that requires GA access, but if this tracking is important, it would be good to convert everything to Universal Analytics, because old format is being phased out.

Searched entire Meta SVN repo, and all references to Google Analytics I could find were in:

  • /sites/trunk/trac.wordpress.org/templates/site.html:313 (ID 52447-27, old format)
  • /sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-apps/footer.php:46 (ID 52447-51, new format)

ID for property used at all sections of wordpress.org is 52447-1, so that can be changed from repo.

#3 @Otto42
3 years ago

There's other places it's being used as well, in the private parts of the repo. We'll have to go through and find all the various instances. Maybe unify them in some manner.

#4 @deconf
3 years ago

Just make sure that all Properties have been upgraded if you plan to make the update before Phase 4, see the upgrade timeline.

In addition, events tracking like these:

view-source:https://wordpress.org/

function recordOutboundLink(link, category, action) {
	_gaq.push(['_trackEvent', category, action])
	setTimeout('document.location = "' + link.href + '"', 100);
}

should also be updated

Last edited 3 years ago by deconf (previous) (diff)

#5 @slobodanmanic
3 years ago

@otto42: if there's any way I can help with this, I'd love to do it.

#6 @igorkol
3 years ago

Exactly @deconf
The events have to be changed in the code or else the update of the GA to UA code won't do any good

@slobodanmanic
You've outrun me for a day in reporting this issue :) Updating the code is what I wanted to do as well.

This ticket was mentioned in Slack in #meta by ocean90. View the logs.


23 months ago

This ticket was mentioned in Slack in #meta by sam. View the logs.


23 months ago

Note: See TracTickets for help on using tickets.