This guide will walk you through the steps to create a Google Tag Manager account and link it to Google Analytics 4. It’ll use https://dev.onecampus.com as an example.
- Go to https://tagmanager.google.com/
- Click on “Create Account” on the top right corner (if you don’t have one for OneCampus):
- Enter the account details on the page that shows up (the target platform is Web):
- Click “Yes” to agree on the Google Tag Manager Terms of Service Agreement.
- You don’t need to copy anything from the modal titled “Install Google Tag Manager” as OneCampus already has those scripts populated, except for the Google Tag Manager ID or GTM-ID:
- The GTM-ID shows up on the top right (and in both scripts) as GTM-5T9LPHW. Only copy the part after the dash “5T9LPHW” and put in OneCampus under the Tenant Setting “Google Tag Manager ID and Save:
- Next, go to https://analytics.google.com/
- Hover over the left navigation area and click on “Admin” on the bottom left corner:
- From the top of the page, click on “Create Account” (if you don’t have one for OneCampus):
- Enter the account name and choose the sharing settings and hit Next:
- Then proceed to create a property by putting its name, timezone, and currency:
- Add the details about your business/college/university on the next page, then hit create.
- Check the two boxes on the modal for Google Analytics Terms of Service Agreement and click “I Accept”.
- The Data Streams page will show up, choose the “Web” platform to create a data stream:
- Enter the stream/website details, then click Create stream:
- The following page will show up with details about your stream:
- Copy the “MEASUREMENT ID” and use it in OneCampus under the Tenant Setting Google Analytics ID and hit Save:
- Go back to Google Analytics, and on the same page (the Web stream details page) where you copied the measurement ID, scroll down and read the instructions under Tagging Instructions -> Use existing on-page tag -> Google Tag Manager:
- Go Google Tag Manager, either click on the “Add a new tag” box under Overview or click on Tags on the left navigation, then “New” to create a new Tag:
- Name the Tag on the top left corner and you will need to create both Tags and Triggers:
- Click on the Tag Configuration box and select Google Analytics: GA4 Configuration:
- On the configuration page, paste your Measurement ID that was copied from Google Analytics. In our case, it’s G-PSG37C6Y83. Adjust the fields and properties as you see fit to your use case:
- Scroll down to create triggers and choose when the tag would fire. Click on the “Triggering” box and choose a trigger (you’ll likely want GA4 to fire on all pages), and hit Add:
- The Tag configuration page should look like this after adding the trigger. Proceed by hitting Save:
- OPTIONAL: if you want to utilize GA4 built-in event tracking, such as scroll activity, outbound clicks, etc., you’ll need to create another Tag, name it, and choose the Google Analytics: GA4 Event tag type:
- In the Google Analytics: GA4 Event configuration page, add the GA4 Configuration Tag we just created (in our case, it’s called Dev Tag. Add your event name, parameters, and properties that fit your use case:
- Scroll down the triggers and choose where this event would fire (we picked all pages as before). The Google Analytics: GA4 Event configuration page looks like this after adding the trigger. Hit Save:
- The “Tags” page should list both the GA4 Event and GA4 Configuration Tags:
- Your Overview page should list the changes. You can click Submit on the top right corner to publish those changes:
- Add a version name and description, then hit Publish on the top right corner:
- This is how it looks after it gets published:
- At this point, you can go back to Google Analytics website -> Home and start observing traffic. This message should disappear after 24-48 hours:
- I visited https://dev.onecampus.com and Google Analytics was able to detect that in a few seconds:
- If you click on “View realtime” it should show more details about the activity. For instance, I viewed three TDPs (bouncing back to the front page after each view), and scrolled:
Related to
Updated