Opened 9 years ago
Closed 6 years ago
#1017 closed defect (bug) (fixed)
Google Analytics code uses old (deprecated format)
Reported by: | slobodanmanic | Owned by: | dd32 |
---|---|---|---|
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 (22)
#2
@
9 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
@
9 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
@
9 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
#6
@
9 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.
9 years ago
This ticket was mentioned in Slack in #meta by sam. View the logs.
9 years ago
#11
@
6 years ago
Updated:
- WordPress.org
- WordPress.org/themes
- Codex.WordPress.org
- BuddyPress.org
- bbPress.org
- mu.WordPress.org
Others that were already using the newer tracker:
- core.trac.wordpress.org
Other properties not yet updated:
- pingomatic.com
- browsehappy.com (Still using urchin.js)
@coffee2code Do you have access to pingo and BH?
#12
@
6 years ago
@joostdevalk @jonoaldersonwp Could you summarize here what kinds of immediate changes you are thinking of to better leverage WP.org's GA implementation? In terms of additional data collection, it would also be good to summarize their purpose.
/cc @Otto42 @tellyworth
#13
@
6 years ago
We need to enable the 'anonymiseIP' function throughout the whole ecosystem, otherwise we're in a bad place for GDPR. Whilst we're at it, we may as well update to the new syntax, as the current one will eventually be deprecated.
There's a world of additional stuff which we *could* do, but we've got some planning and basic housekeeping to do first, and this is an urgent privacy requirement.
#14
@
6 years ago
@jonoaldersonwp I set up gtag as documented and used their outbound link tracker code pretty much verbatim. The only way I can keep these footer links working is if I use their `createFunctionWithTimeout()` wrapper to not having to wait until event_callback
gets called. Which feels like something that should be done regardless.
#15
@
6 years ago
Oh, are we using the outbound link tracking primarily for cross-network navigation via the footer links?
If that's the case, I'd be interested if anybody actively looking at this data - if not, we could shelf this for now, and I'll scope a better solution in the coming weeks.
This ticket was mentioned in Slack in #meta by obenland. View the logs.
6 years ago
#19
@
6 years ago
Updated to use Google Tag Manager:
- WordPress.org
- WordPress.org/themes
- BuddyPress.org
- bbPress.org
- mu.WordPress.org
Needs a cache refresh:
- Codex.WordPress.org
Other properties not yet updated:
- pingomatic.com
- browsehappy.com
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.