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
- Choose a business size that represents your unit or org
- Click Next
- Choose Get baseline reports from the business objectives
- Click Create
- 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
- 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
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
- Click on the Variables tab in the left menu
- Click New in the User-Defined Variables pane
- 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
- In the Variable Configuration pane, paste the Measurement ID from your GA4 account property Web Data Stream
- Click 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
- Select Google Analytics: GA4 Configuration from the Choose tag type options
- Click on the button to the right of the Measurement ID field
- Select the Measurement ID variable we created earlier
- Click on the Trigger pane
- Select the All Pages built-in trigger
- Click 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
- 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
- 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