Feature #6090

Google Analytics - add support for Universal Analytics

Added by Tim Hutchinson over 5 years ago. Updated 3 months ago.

Status:VerifiedStart date:12/06/2013
Priority:MediumDue date:
Assignee:Sara Allain% Done:

0%

Category:Reporting
Target version:Release 2.5.0
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:

Description

I'm not sure if this was already on the radar, but I've been looking into the ongoing changes to Google Analytics.

According to the Universal Analytics upgrade guide (https://developers.google.com/analytics/devguides/collection/upgrade/?hl=en_US), "All Google Analytics properties will soon be required to use Universal Analytics. Any properties that don’t follow the upgrade process will be auto-transferred to Universal Analytics in the future."

The javascript snippet for Universal Analytics looks like this:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-25753643-7', 'scaa.sk.ca');
  ga('send', 'pageview');

</script>

The only new variable seems to be the domain, which may already exist as a setting somewhere; or else would need to be extracted or added as a parameter.

The native support for Google Analytics is a very helpful addition, by the way - I lost a few months of data since we forgot to re-add the snippet after upgrading. And the ability to track by institution looks very interesting.


Related issues

Related to Access to Memory (AtoM) - Task #12209: Add Google Analytics custom dimension for institution names Verified 03/29/2018

History

#1 Updated by Tim Hutchinson over 5 years ago

Actually, it looks like the top-level domain is only needed to support cross-domain tracking (which would be useful). My snippet might have been generated that way since I have several properties within a single account. See:
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs#cross-domain
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs#snippet

#2 Updated by Dan Gillean over 5 years ago

  • Category set to Web service API
  • Assignee set to Jesús García Crespo
  • Target version set to Release 2.0.2

#3 Updated by Jesús García Crespo almost 5 years ago

  • Target version changed from Release 2.0.2 to Release 2.1.0

#4 Updated by David Juhasz almost 5 years ago

  • Description updated (diff)

Wrap <script> in <pre>

#5 Updated by Jesús García Crespo almost 5 years ago

  • Target version changed from Release 2.1.0 to Release 2.2.0

#6 Updated by Sarah Romkey over 4 years ago

  • Target version deleted (Release 2.2.0)

#7 Updated by Dan Gillean about 4 years ago

  • Project changed from Access to Memory (AtoM) to AtoM Wishlist
  • Category deleted (Web service API)

Moved to AtoM wishlist until sponsored for inclusion.

#8 Updated by Jesús García Crespo about 4 years ago

  • Assignee deleted (Jesús García Crespo)

#9 Updated by Mike Cantelon about 1 year ago

  • Status changed from New to Feedback
  • Assignee set to David Juhasz

I think this issue was fixed by Radda recently in this commit relating to #12209:

https://github.com/artefactual/atom/commit/8b8322ee8ac8f46904be0b65e332964143d577cc

According to https://developers.google.com/analytics/devguides/collection/analyticsjs/ we are now using (in apps/qubit/templates/_footer.php) a JS snippet that references analytics.js (Universal Analytics) rather than the old ga.js library. The snippet we're currently using, if I'm reading the docs correctly, offers better performance than the snippet in this issue's description.

#10 Updated by José Raddaoui Marín about 1 year ago

  • Target version set to Release 2.5.0

Good catch Mike! Already added to qa/2.5.x.

#11 Updated by David Juhasz about 1 year ago

  • Status changed from Feedback to QA/Review
  • Assignee changed from David Juhasz to Dan Gillean

Dan, assigning to you for QA and documentation.

#12 Updated by Dan Gillean about 1 year ago

  • Related to Task #12209: Add Google Analytics custom dimension for institution names added

#13 Updated by Dan Gillean about 1 year ago

  • Project changed from AtoM Wishlist to Access to Memory (AtoM)
  • Assignee changed from Dan Gillean to Sara Allain

See also #12209

Sara Allain has been working on documentation and testing for Institutional views already: https://github.com/artefactual/atom-docs/pull/43

#14 Updated by Sara Allain about 1 year ago

  • Status changed from QA/Review to Verified

This was resolved as part of this PR: https://github.com/artefactual/atom/pull/706

#15 Updated by Dan Gillean 3 months ago

  • Category set to Reporting

Also available in: Atom PDF