Drupal: Configure Google Analytics for Your Site

Curious where your site's traffic is coming from or how people navigate around your site? You can add Google Analytics to your site to help monitor its traffic.

Note: You can use Google Analytics at the University of Minnesota with all Drupal Enterprise and Drupal Lite web sites. However, Google Analytics is not supported by Technology Help. If you are part of the University's Health Care Component (HCC), you will need to request an exception to use Google Analytics.

Standard implementation allows access to Google Analytics' out-of-the-box dimensions and metrics. For custom tracking (scroll depth, click activity, custom tagging), implementation will need to be done through Google Tag Manager. Please consult with the University Relations Measurement and Analytics team for more information. Please use this form to request a Marketing and Analytics consultation.

This article will cover:

Logging In to Google Analytics

  1. Go to analytics.google.com.
  2. Enter your UMN email address and select Next.
  3. Log in with your University Internet ID and password.
  4. If this is your first time logging in, select the Start measuring button to proceed.

Setting Up Your Website in Google Analytics

Before proceeding, determine if your unit already has an Analytics account to which your site should be added. We strongly advise consulting with your campus, college, or unit's Marcom Lead to understand any current Google Analytics usage. For more information and guidance, please visit the Marcom Leads website. If you are using an existing Analytics account, skip to Create a New Property Within an Existing Account (on this page).

Creating a New Google Analytics Account

  1. Select the gear button in the lower left sidebar to access the Google Analytics admin dashboard.
  2. On the top left, select + Create and select Account.
    Google Analytics admin interface. Under the + Create dropdown button are the Account and Property options.
  3. On the Create an account page, enter the Account Name. This is used to identify the analytics account from others you may have. Choose options for Account Data Sharing Settings, then select Next.

Creating a New Property Within an Existing Account

  1. Select the gear button in the lower left corner to access the Google Analytics admin dashboard.
  2. Select the + Create button in the upper left and select Property.
    Google Analytics admin interface. Under the + Create dropdown button are the Account and Property options.

Completing Property Setup

  1. Enter a Property Name that clearly identifies the website and select your Reporting Time Zone, then select Next.
  2. Fill out the Business details section, then select Next.
  3. Fill out the Choose your business objectives and select Create.
  4. When the terms and conditions display, select I Accept.
  5. Select Web on the "Start collecting data" page.
  6. Enter the Website URL and Stream name for the site you'll be tracking and select Create stream.
    • Note: Consider enabling Enhanced Measurements for more detailed tracking such as outbound links, form fill outs and 90% scroll depth.
    • ***Some settings may duplicate events IF using Google Tag Manager. Please consult with the University Relations Measurements and Analytics team for additional information.***
  7. Record the Measurement ID on the "Web stream" details page. The format will be G-XXXXXXXXXX, where the Xs are a random string of letters and numbers.

Linking Your Google Analytics Account to Your Drupal Site

  1. Copy the Measurement ID or Google Tag Manager Container ID that was generated when you created your new Google Analytics Account or Google Tag (if using Google Tag Manager).
  2. Log in to the Drupal Site you would like to track with this ID.
  3. Select Manage in the menu bar to expand the administrative menu.
  4. Select Configuration.
  5. Select Google Tag in the Web services category.
  6. Enter the Measurement ID or Container ID into the Web Property ID box.
  7. Under Custom dimensions and metrics, select Dimension in the drop-down menu and select Add new parameter.
  8. Enter cookie_domain in the Name field and your website domain name in the Value field (i.e. my-site.umn.edu).
    Drupal Google Tag admin settings. cookie_domain is entered under Name. my-site.umn.edu is entered under Value.
  9. Select Save at the bottom of the page.
  10. In order for this change to take effect, you will need to clear the varnish cache for your website. It can take up to 48 hours for Google Analytics to detect your tracking code and any changes to your configuration.

Last modified

Changed

TDX ID

TDX ID
3377