Today, understanding user behavior on your website is crucial for making informed decisions and optimizing your online presence. Google Analytics 4 (GA4) is the latest iteration of Google’s powerful analytics platform, offering advanced features and improved insights. In this guide, we will walk you through the step-by-step process of setting up Google Analytics 4 for your new website using Google Tag Manager.
Step 1: Create a Google Analytics Account
If you don’t already have a Google Analytics account, you’ll need to create one.
- Visit the Google Analytics website and sign in with your Google account.
- In the Admin panel, click Create, and choose Account.
- Create an account name and configure the data-sharing settings to set up the data you are going to share with Google.
- Then go Next to add the first property to the account.
Step 2: Set Up a New Property
Once your account is created, you’ll need to set up a new property for your website. You will need the Editor role to manage properties on your GA4 account. If this account was created by you, you will have the Editor role by default. To create a new property follow these steps:
1. Go to the Admin tab, then click Create and select Property. Enter details like the name of the property, time zone, and currency. Click Next.
2. Choose your industry category and business size. Click Next.
3. Set up the way you are going to use Google Analytics. Click Create and accept the Analytics Terms of Service and the Data Processing Amendment.
4. Then add a data stream to start collecting data. Choose Web to enable data collection for your site.
5. Enter the website URL and enter a stream name. Then, click Create stream.
Great! You’ve successfully completed the setup of Google Analytics on your account. Now it’s time to integrate it into your website. There are three ways to install Google Analytics depending on your website and context:
- Install GA4 with a Google Analytics plugin/integration
- Install with GTAG (a.k.a. Google Tag, a.k.a. native GA4 tracking code)
- Install GA4 with Google Tag Manager
Let’s have a look at the third point as an example.
Step 3: Create a Google Tag Manager Account
1. Go to the Google Tag Manager homepage. Log in with your Google account.
2. Proceed to the Account Setup. Complete the details mentioned on the page like Account name and country.
3. On Container Setup, create a container name and choose your target platform. For example, enter your website name and click on Web if you want to measure your site. Then, click Create.
4. Accept the Google Tag Manager Terms of Service Agreement.
5. After that you will receive the code snippet you will need to paste on the <head> and <body> tags on your website. Just copy each tracking code by clicking on the icon. Here is an example of how to insert the tracking code into your WordPress website.
a. Go to the Admin Page of your website in WordPress.
b. Navigate to Appearance – Theme File Editor.
c. Find the header.php template under the Theme Files and copy the code snippets to the <head> and <body> tags.
d. When you finish, click Update File to save the changes.
6. The next step is to navigate to your Google Tag Manager dashboard and click Add a new tag.
7. Choose a tag type to begin setup.
8. Select the Google Analytics 4 Configuration option and enter the Measurement ID in a relevant field. You can find it in the Admin -> Property -> Data Streams menu. Choose the data stream you’ve made, and you will find your measurement ID. Copy it.
9. Follow your Google Tag Manager container > Tags > New and choose Google Tag. Paste the copied measurement ID in the Tag ID field.
10. In the Triggering section, select Initialization – All Pages and then name the tag.
11. Then it’s time to test it. Click Preview in the top right corner of the GTM interface. When you enable the preview mode, you will see the new Google tag among the tags that fired.
Step 4: DebugView in Google Analytics 4
After you’ve completed the process of installing Google Analytics 4, the best practice is to test whether it works correctly. Here comes the DebugView feature. You can find it at Google Analytics 4 account > Admin > Debugview.
1. You will probably see only blank space there. To see data in the DebugView you need to enable the debug mode in GA4. If you installed GA4 with Google Tag Manager, having the GTM Preview mode enabled automatically makes the data visible in the GA4 DebugView.
2. Begin observing data in DebugView. Explore each event individually to access the list of parameters.
3. Select the specific parameter to view the value received by GA4. This level of debugging granularity provides valuable insights. The presence of your events in DebugView confirms the proper installation of GA4.
Step 5: Publish Changes in Google Tag Manager
This step is necessary only when utilizing GTM for GA4 installation. After verifying the incoming data and ensuring its proper display, proceed to submit your GA4 changes within the GTM container and publish them.
To accomplish this, click the Submit button located in the top right corner and follow the subsequent steps as prompted by the user interface.
Step 6: Test and Verify Your Setup
Before relying on the data collected, perform a thorough test of your GA4 setup. Use the “Realtime” report to ensure data is being tracked accurately. Additionally, run a few test scenarios on your website to confirm that events and conversions are being recorded correctly.
Once your setup is verified, explore the various reports and insights GA4 provides. Gain a deeper understanding of user behavior, traffic sources, and the effectiveness of your marketing efforts. Use these insights to make data-driven decisions and continually optimize your website.
Conclusion
Setting up Google Analytics 4 for your new website is a crucial step in understanding your audience and improving your online presence. By following these comprehensive steps, you’ll have a solid foundation for collecting and analyzing valuable data. Keep in mind that GA4 is a powerful tool that evolves, so stay updated on new features and best practices to make the most of this analytics platform. Happy tracking!