Configuring Google Analytics 4 can look a bit complex, but once you understand your options, you can make the best decision for implementation. We won’t cover a step-by-step implementation in this course. Please refer to our online guides for these specific steps. The key take-away for this lesson is to understand the first steps and the two options for implementation.
There are two main options for implementation: using the Gtag javascript library or Google Tag Manager (GTM). Gtag is a JavaScript library provided by Google for implementing various Google tags, including GA4. With gtag.js, you directly add the tracking code to your website's HTML. GTM is a tag management system that allows you to manage various tracking tags, including GA4, through a user-friendly interface. Instead of manually adding code to your web pages, you implement the GTM container code on your site, and then you can manage and deploy tags through the GTM interface. You'll set up a GA4 tag within GTM, configure the tracking parameters, and publish the changes.
The first step for either one of these options is to create a GA4 property in your Google Analytics account and obtain the measurement ID associated with it. The measurement ID is a unique code that is dedicated to your GA4 property (e.g., “G-A1B2C3D4E5”). You need to add this code to the Gtag code snippet or to the GA4 configuration tag in GTM. It is important to remember that in either case, his measurement ID has to be present on every single page that you are planning to track in GA4. We generally recommend using GTM for implementation, as it provides a lot more options and gives you more flexibility as measurement needs evolve. However, for smaller sites, Gtag can definitely get the job done.
Events are the building blocks of GA4 reports. There are four categories of events in GA4:
- Automatically collected events: are collected automatically with basic data collection
- Enhanced measurement: are collected automatically if you have enabled enhanced measurement
- Recommended events: are events that you implemented yourself, but that have predefined names and parameters
- Custom events: are events that you name and implement yourself
Google Analytics has a schema for events that follows a basic hierarchy: category, action, label and value. This allows users to categorize events (e.g., “user_engagement”), map the specific user actions (e.g., “button_click”), associate these actions with a label to better understand where or how they took place (e.g., “page_title”) and, finally, add a specific or estimated value for these actions (e.g., “$10”). On top of these four standard data fields, you now have the option to send additional data to GA4 by using a much more flexible setup via custom event parameters.
Quiz
Back Next Lesson