WordPress.org

Making WordPress.org

Opened 3 years ago

Last modified 11 days ago

#1017 reviewing defect

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 (21)

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


2 years ago

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


2 years ago

#9 @tellyworth
4 months ago

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

#10 @dd32
3 months ago

In 7113:

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

See #1017.

#11 @dd32
3 months 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
4 weeks 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
4 weeks 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
4 weeks 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
4 weeks 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.


3 weeks ago

#17 @obenland
3 weeks ago

In 7340:

Trac: Use Google Tag Manager for analytics.

See #1017.

#18 @obenland
3 weeks ago

In 7343:

Themes: Remove ga reference.

Google Tag Manager will count pageviews based on history updates.

See #1017.

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


2 weeks ago

#21 @coffee2code
11 days ago

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

Note: See TracTickets for help on using tickets.