University at Buffalo - The State University of New York
Skip to Content
UB Web Management

Transforming UB’s digital communications through process and tools

Google Analytics

Track your site's usage and performance using Google's toolkit.

On this page:

Set Up Google Analytics

Google provides very powerful and free site usage tracking tools called Google Analytics. We encourage every site at UB to use their tools on a regular basis to better understand how their sites are being used, and to set and monitor usage goals.

If you have not already registered for a Google Analytics account, please register at Google Analytics. To do this, you will first need a Gmail account (see Google’s “Get Started”).

In addition to this standard suite, University Communications has developed supplementary tools that track more specialized behavior that is not tracked by the basic Google Analytics tools, like file downloads, video playing, searches, and external link clicks.

If you choose to join University Communications' tracking portfolio, just let us know the UA- tracking code for your Google Analytics site.  

Contact University Communications for more information about joining our Google Analytics portfolio or if you are having difficulty registering your site in Google Analytics.

Setting Up Tracking in the UBCMS

Google Analytics will automatically record metrics such as visitors, unique visits, time on page, how many times a page is viewed, as well as information about visitors' devices and geographic origin. However, their default tracking system will not register metrics on 'events' like links clicked on each page, YouTube views or file downloads. To collect this data, you will need to implement an advanced system (see Advanced Tracking below).

Once you add the tracking code to your home page, it will be used to track your entire site.

  1. Log in to the UBCMS and navigate to the home page of the site you wish to track. (This code will turn on tracking for your entire site.)
  2. Open the page and in the Sidekick, select the Page tab.
  3. Click Page Properties.
  4. Select the Advanced tab.
  5. Scroll down and click on the arrow to expand the Google Analytics section.
  6. For the Analytics Type, choose from:
    • None
    • Google Analytics - This setting may still appear on older UBCMS sites. Please switch to one of the newer settings.
    • Classic Analytics - (deprecated) This was the standard way most site usage was tracked, equivalent to the old 'Google Analytics' UBCMS setting. Google will be aggressively pushing sites into a newer Universal Analytics system (details).
    • Universal Analytics - Google's new usage tracking system that may not be compatible with our HTML Packages that do events tracking. We instead recommend switching to Tag Manager.
    • Tag Manager - A new alternate tracking system using a new ID number; e.g., GTM-ABCDEFGH'.
  7. ID / Snippet - Paste in your Google Analytics ID;
    e.g. UA-12345678 for Classic/Universal Analytics
    e.g. GTM-ABCDEFGH' for Tag Manager.
    • Do not enter the entire <script> Google provides
    • If you join University Communications' portfolio, you will need to paste in UC's GTM number.
  8. Click Okay.
  9. If your site was live, you will need to reactivate the page.

You are now ready to track your site through the Google Analytics website. It will take several hours before data is available.
 

Classic vs. Universal vs. Tag Manager

Classic Analytics is Google's original standard for tracking website usage. Old UBCMS sites may still have the Google Analytics set in their Page Properties, or even a blank setting. Please update this to either Universal Analytics or the recommended Tag Manager setting.

Universal Analytics is Google's new standard for tracking website usage and Google plans to incrementally force all sites into the new system (details).

Tag Manager is an alternative to Universal Analytics, and will allow University Communications to implement a single cross-site suite of parameters.
(Read more about upgrading to Tag Manager -- sites that join University Communications' portfolio will not need to upgrade independently.)  

Advanced Tracking (pre 2015)

Advanced tracking of your site will also count what Google calls "Events" metrics, such as clicks on each link or file download (using the <a href> code), embedded YouTube use (from our Video Component) and heatmap data (x-y coordinates for mouse actions).  

  1. Request the latest HTML Package from the UBCMS Help Desk. It will be a zip file (e.g. package.zip).
  2. Open the zip file. You should see a folder that includes index.html plus some .js files.
  3. Open the index.html file in Notepage (Windows) or BBEdit (MAC). Do not use WordPad, Word or TextEdit.
  4. Within index.html, look for the UA- number and replace with your own tracking code. Be careful not to overwrite the single quotes or any surrounding text.
  5. Save the index.html file.
  6. Rezip the entire folder including the .js files. (The final file name can be anything ending in .zip.)
    • In Windows, right click and select Send to then Compressed (Zipped) Folder.
    • On a Mac, use Compress.
  7. Log in to the UBCMS and navigate to the site you wish to track.
  8. Within the Site-Wide Configuration folder, open the Footer page
  9. Make sure there is no HTML Package already in place for tracking.
  10. From the Sidekick, drag in an HTML Package from the Specialist Components.
  11. Open the component and upload your zip file.
  12. For the component's Description, add "Google Analytics Events Tracking mm/dd/yy."
  13. Click OK.
  14. Remove any UA code from the Page Properties (see Simple Tracking above).
  15. If the site was live, reactivate the page.

You are now ready to track your site through the Google Analytics website. It will take several hours before data is available.

Advanced Tracking (2015 on)

Universal Analytics

This will be Google's standard for website usage tracking going forward. Site administrators will be pushed to upgrade to Universal Analytics. Unit Web Leaders are welcome to upgrade to Universal Analytics, but should be advised that this new system may not be compatible with our events-tracking HTML Packages; we recommend using Tag Manager instead.

University Communications has no plans to support Universal Analytics at this time.

Tag Manager

This is an alternative to Universal Analytics. University Communications will build and manage a comprehensive suite of tagging rules (a 'Container'), and we welcome all sites to join our portfolio. If you join with us, you will not need to maintain your own tagging rules or even to register in the Tag Manager interface.  Our Container will automatically send usage data to your own Google Analytics account so you will be able to simply log into your admin account to view the latest usage data.

If you wish to develop your own portfolio, you may request an export of our Container for your own use but you will need to then update it independently.

Contact University Communications for more information about joining our Google Analytics portfolio or if you are having difficulty registering your site in Google Analytics.

Is the Tracking Working?

  • Google should begin to track your site almost immediately, but data may not be available until the next day.
  • Once data has been collected, you can browse the data on the Google Analytics site.
  • If you are concerned the code is not working, try adding the Google Analytics Debugger to Chrome.
    • Click Settings, More Tools and Extensions. Search for the add-on and click (+) to add it to your browser.
    • It should install instantly. Turn on the extension in the upper right of the browser.
    • Navigate to your published home page.
    • From Settings, select More Tools and Developer Tools. A frame should open at the bottom of the browser.
    • Click the Console Tab, then in the log, look for a line with your UA code;
      e.g. _gaq.push processing "_setAccount" for args: "[UA-1499965-40]":
    • This means your tracking code is working. (Click the X at the upper right of the frame to exit this mode.)
  • UBCMS redirect pages are not tracked as pages in Google Analytics even if they link to another page on your site, although their target will be tracked as a Landing Page (if it contains a GA code). However, if you have Events turned on, the clicks on the link to that redirect page are tracked.
  • UBCMS data collected by Google before May 30, 2012 is not reliable. Visit the Known Issue to learn more.

Additional Considerations

Google Analytics data prior to May 30, 2012 will include statistics from both the authoring and live environments and therefore will not accurately reflect public use of websites published on the UBCMS before June, 2012.  This will also disproportionately affect smaller, less trafficked sites. > Learn more

Was this page helpful?

(Required)
(Required)
(so we can thank you or request more details)
(Required)
(buffalo.edu addresses only please)