Making WordPress.org

Opened 10 years ago

Closed 6 years ago

#1017 closed defect (bug) (fixed)

Google Analytics code uses old (deprecated format)

Reported by: slobodanmanic's profile slobodanmanic Owned by: dd32's profile 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)

#1 @obenland
10 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
10 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
10 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
10 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 10 years ago by deconf (previous) (diff)

#5 @slobodanmanic
10 years ago

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

#6 @igorkol
10 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

#9 @tellyworth
7 years ago

  • Owner set to dd32
  • Status changed from new to reviewing

#10 @dd32
7 years ago

In 7113:

Themes Directory: Upgrade the Google tracking style to the new analytics tracker.

See #1017.

#11 @dd32
7 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 @obenland
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 @jonoaldersonwp
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 @obenland
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 @jonoaldersonwp
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

#17 @obenland
6 years ago

In 7340:

Trac: Use Google Tag Manager for analytics.

See #1017.

#18 @obenland
6 years ago

In 7343:

Themes: Remove ga reference.

Google Tag Manager will count pageviews based on history updates.

See #1017.

#19 @obenland
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

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


6 years ago

#21 @coffee2code
6 years ago

browsehappy.com has now been updated to use Google Tag Manager.

#22 @coffee2code
6 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

pingomatic.com has now been updated to use Google Tag Manager as of [431-pingomatic] and [432-pingomatic].

As the last property needing to do so, I'm marking this ticket as fixed.

Note: See TracTickets for help on using tickets.