Virginia Tech® home

How Do I ... Set Up Google Analytics 4 and Google Tag Manager For Custom Event Tracking

This document includes links and instructions for setting up Google Analytics 4 and Google Tag Manager accounts for use with custom site event user tracking.

NOTE: The themes in Ensemble already have generic pageview data recorded across all sites. You only need separate accounts if you need more than just the standard pageview analytics data.

Create Google Analytics account and property

  • Log into Google Analytics with your vt.edu credentials
  • Click the Create Account button
  • Type a name in the name property input and set time zone
  • Click Next
Google Analytics 4 Account Property Details Dialog
Google Analytics 4 Account Property Details Dialog
  • Choose a business size that represents your unit or org
  • Click Next
  • Choose Get baseline reports from the business objectives
  • Click Create
Google Analytics 4 Account Property Business Size Choices
Google Analytics 4 Account Property Business Size Choices
Google Analytics 4 Account Property Business Objectives Choices
Google Analytics 4 Account Property Business Objectives Choices
  • Choose Web from the patform choices
  • Type the site domain and name the web data stream
  • Click Create Stream
  • Copy the Measurement ID from the Web stream details
  • NOTE:¬†Close the top open pane if over the pane with Measurement ID
Google Analytics 4 Account Property Platform Choices
Google Analytics 4 Account Property Platform Choices
Google Analytics 4 Account Property Stream Set Up
Google Analytics 4 Account Property Stream Set Up
Google Analytics 4 Account Property Web Stream Details
Google Analytics 4 Account Property Web Stream Details
  • Click Next
  • Click Continue To Home
  • Choose No in the migrate dialog and click Save
  • Leave this window or tab open if you need to reference the Measurement ID later
Google Analytics 4 Account Property Web Stream Finish
Google Analytics 4 Account Property Web Stream Finish
Google Analytics 4 Account Property Data Pending Message
Google Analytics 4 Account Property Data Pending Message
Google Analytics 4 Account Property Migrate Message
Google Analytics 4 Account Property Migrate Message
Google Analytics 4 Admin Property Data Streams
Google Analytics 4 Admin Property Data Streams

Create Google Tag Manager account and container

  • Log into Google Tag Manager with your vt.edu credentials
  • Click the Create Account button
  • Type a name in the name property input and set time zone
  • Click Next
  • Click Yes for Terms of Service
  • Close the embed snippet dialog; we just need the tag manager container ID for Ensemble later
Google Tag Manager Create Account
Google Tag Manager Create Account
Google Tag Manager Account Configuration
Google Tag Manager Account Configuration
  • Click on the Variables tab in the left menu
  • Click New in the User-Defined Variables pane¬†
Google Tag Manager Account Container Overview
Google Tag Manager Account Container Overview
Google Tag Manager Variable Tab
Google Tag Manager Variables Tab
  • Click on the Untitled Variable name and type a name for your GA4 Measurement ID and the RETURN key
  • Click on the Variable Configuration pane
  • Scroll the Variable Type list and select Constant
Google Tag Manager Create Variable
Google Tag Manager Create Variable
Google Tag Manager Variable Type - Constant
Google Tag Manager Variable Type - Constant
  • In the Variable Configuration pane, paste the Measurement ID from your GA4 account property Web Data Stream
  • Click Save
Google Analytics 4 Admin Property Data Streams
Google Analytics 4 Admin Property Data Streams
Google Analytics 4 Account Property Web Stream Details
Google Analytics 4 Account Property Web Stream Details
Google Tag Manager Variable Paste Measurement ID Value
Google Tag Manager Variable Paste Measurement ID Value
Google Tag Manager Variable Save
Google Tag Manager Variable Save
  • Click on the Tags tab in the left menu
  • Click New in the Tags pane
  • Click on the Untitled Tag name and type a name for your GA4 Pageviews tag and the RETURN key
  • Click on the Tag Configuration pane
Google Tag Manager Tags Tab
Google Tag Manager Tags Tab
Google Tag Manager Create Tag
Google Tag Manager Create Tag
  • Select Google Analytics: GA4 Configuration from the Choose tag type options
  • Click on the button to the right of the Measurement ID field
Google Tag Manager Tag Configuration - Tag Type - GA4 Configuration
Google Tag Manager Tag Configuration - Tag Type - GA4 Configuration
Google Tag Manager Tag Configuration - Tag Configuration Dialog
Google Tag Manager Tag Configuration - Tag Configuration Dialog
  • Select the Measurement ID variable we created earlier
  • Click on the Trigger pane
  • Select the All Pages built-in trigger
  • Click Save
Google Tag Manager Tag Configuration - Tag Configuration - Choose Measurement ID variable
Google Tag Manager Tag Configuration - Tag Configuration - Choose Measurement ID variable
Google Tag Manager Tag Triggers - Choose Trigger - All Pages
Google Tag Manager Tag Triggers - Choose Trigger - All Pages
Google Tag Manager Tag Save
Google Tag Manager Tag Save
  • From the container Overview tab, click the Submit button in the top-right
  • Type a Version Name and Version Description
  • Click Publish
  • Close the publish summary
Google Tag Manager Container Overview - Submit
Google Tag Manager Container Overview - Submit
Google Tag Manager Container Overview - Submit Dialog
Google Tag Manager Container Overview - Submit Dialog
Google Tag Manager Container Overview - Publish Info
Google Tag Manager Container Overview - Publish Info
  • Carefully select the GTM-XXXXXX container ID from the top-right of the Overview tab, start with the pointer left of the actual text and then click and drag to select
  • Copy the container ID to the clipboard
Google Tag Manager Container Overview - Select GTM ID - GTM-XXXXXX
Google Tag Manager Container Overview - Select GTM ID - GTM-XXXXXX
Google Tag Manager Container Overview - Copy GTM ID
Google Tag Manager Container Overview - Copy GTM ID
  • Open the Ensemble author site in another browser window or tab
  • Select with the checkbox or by clicking on the icon your site level page
  • Click Properties in the actions menu
  • Click on the Site Configuration tab
  • Paste the GTM-XXXXXX ID into the Google Tag Manager ID field
  • Click Save and Close
  • Publish the site level, en, and index pages
  • You should now be able to see Realtime data in your analytics account; other panes will populate as more data is acquired
Ensemble Site Configuration Dialog with GTM ID
Ensemble Site Configuration Dialog with GTM ID