Set-up Analytics For Your Site

To track Google Analytics on a website, every page that should be tracked must have a block of javascript code included on it. York uses one account to track most pages that are publicly accessible and on the yorku.ca domain. This code is included in the York banner that should appear at the top of every Yorku.ca webpage.

Multiple sets of Analytics code on a page can lead to inaccurate data collection. The York University account code should be the only one on the page. Read more about the effects of more than one code block on a page.

If your site is off-template but is of direct relevance to Students (eg. a Faculty-wide site), please place the following codes in your pages as per the instructions from Google.

Copy the following JavaScript and paste it as close to the opening <head> tag as possible on every page of your website:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WB2S8R');</script>
<!-- End Google Tag Manager -->

Copy the following snippet and paste it immediately after the opening <body> tag on every page of your website:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-WB2S8R"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

How do I access my group's Analytics?

Login at google.com/analytics with your Google ID. (See our Google ID & Analytics Accounts page for more details.) Check out the "How to Find Your Data" section for information about how to view data for select pages within the York University account.

How do I request access to the information collected?

Anyone who is York-based and affiliated with a website can request access by filling out the GA Access Request form.

Can I add my own GA account to my site?

  • If your site uses the York Template, and / or the York Header, and / or is on the yorku.ca domain and uses non-personalized urls (urls with personally identifyable information) then no -- your site will already be tracked by the York University account.
  • If your site is on a separate domain (not yorku.ca-based) then yes – it will not be tracked by the York University GA account.
  • If your site uses personalized urls, it will not be tracked by the York University GA account. We recommend that you check with the Information and Privacy Office about whether or not it is appropriate to place GA code on the pages at all.