If you’re building a website for your business, one of the most important things you can do is set up website analytics. Google Analytics & Google Tag Manager helps you understand who visits your website, which pages they view, and what content they’re interested in.
In this beginner-friendly guide, I’ll walk you through setting up a Google Analytics 4 (GA4) account, creating a website property, and getting started with Google Tag Manager (GTM).
I’ll also show you how to add your Google Tag Manager container to a WordPress website using the free WPCode plugin, so you can connect everything when you’re ready.
Whether you’re building your first business website or getting your existing website organized, this is an important step toward understanding your website traffic.
What You’ll Need Before Getting Started
Before we begin, make sure you have:
- A Google account that you want to use for your business.
- Your business name.
- Your website domain (you can create your analytics setup before your website launches).
- Access to your WordPress dashboard if you’re following the WPCode installation section.
A quick note: Google Analytics and Google Tag Manager are two different tools that work together.
- Google Analytics 4 (GA4): Collects and reports information about your website visitors and their activity.
- Google Tag Manager (GTM): Helps you manage and deploy tracking tags on your website without repeatedly editing your website’s code.
Step 1: Create Your Google Analytics Account
Start by visiting Google Analytics.
- Sign in using the Google account you want associated with your business.
- Click Start measuring.
- Enter your account name. I recommend using your business name.
- Review the data-sharing options and select the settings that work for your business.
- Click Next.
Your Google Analytics account is where you’ll manage your website’s analytics properties.
Step 2: Create Your Google Analytics Property
Next, you’ll create a property for your website.
A property is where Google Analytics organizes the data collected from a particular website or app.
- Enter a property name. This could be your business name or website address.
- Select your reporting time zone.
- Choose your reporting currency.
- Select the industry category that best describes your business.
- Choose your business size.
- Select the business objectives that best match what you want to learn.
For my Monica Hacks example, I’m interested in user engagement. I want to understand which pages people visit and what content they’re interested in.
You don’t need to spend too much time looking for the perfect industry category. Choose the closest relevant option.
Continue through the setup, review Google’s terms, and accept them if you agree.
Step 3: Create Your Website Data Stream
Once your property is created, you’ll need to set up a data stream.
A data stream tells Google Analytics where you want to collect information.
For a website:
- Select Web as your platform.
- Enter your website URL.
- Give your stream a recognizable name.
- Review the Enhanced Measurement settings.
- Click to create your stream.
For this example, I’m using monicahacks.com.
Enhanced Measurement can automatically collect certain interactions, such as page views, scrolls, outbound clicks, and other events, depending on the settings enabled.
Important: Creating your data stream does not mean your website is collecting data yet. We still need to connect the website to Google Analytics.
Step 4: Find Your Google Analytics Measurement ID
After creating your web data stream, you’ll see its details.
Find your Measurement ID. It typically starts with G-.
This is the identifier you’ll use when connecting Google Analytics to Google Tag Manager.
Keep this ID handy.
Since we’re using Google Tag Manager to manage our tracking, we won’t install the separate Google Analytics tracking code directly into WordPress.
Instead, we’ll configure our Google tag inside Google Tag Manager.
Step 5: Create Your Google Tag Manager Account
Now let’s set up Google Tag Manager.
Visit Google Tag Manager.
- Sign in using your Google account.
- Click to create a new account.
- Enter your business name.
- Select your country.
- Enter a container name. I recommend using your website domain.
- Select Web as the target platform.
- Create your container and review the terms.
Your container is where you’ll organize and manage the tags you want to use on your website.
Once your container is created, you’ll have access to your Google Tag Manager workspace.
Step 6: Create Your First Google Tag
Now that your container is ready, let’s create your first tag.
Inside Google Tag Manager:
- Open Tags in your workspace.
- Click New.
- Give your tag a recognizable name.
For my example, I’m calling mine WP-Config. This is simply a label to help me recognize the tag later.
- Open Tag Configuration.
- Select Google Tag.
- Enter the Google tag ID associated with your Analytics property (your
G-Measurement ID). - Under Triggering, select Initialization – All Pages.
- Save your tag.
The Google tag is what allows information from your website to flow into Google Analytics.
A quick terminology note: Google has updated its tag setup experience. The older GA4 Configuration tag is now called the Google tag. If you’re following an older tutorial, the screens and terminology may look a little different.
Also, saving a tag in Google Tag Manager does not automatically make it live on your website. We’ll still need to install the container, test the setup, and publish our changes.
Step 7: Add Google Tag Manager to WordPress Using WPCode
If you’re using WordPress, you’ll need to install your Google Tag Manager container code on your website.
I use the free WPCode – Insert Headers and Footers plugin to add tracking code without having to edit my theme files.
A. Find Your Google Tag Manager Installation Code
- Open your Google Tag Manager container.
- Find your container ID, which starts with
GTM-. - Click the container ID or select the installation instructions.
- Google will provide two code snippets.
You’ll need both:
- The first JavaScript snippet belongs inside your website’s
<head>section. - The second
<noscript>snippet belongs immediately after the opening<body>tag.
Keep these two snippets separate.
B. Install WPCode on WordPress
If you don’t already have WPCode installed:
- Log in to your WordPress dashboard.
- Go to Plugins → Add New Plugin.
- Search for WPCode – Insert Headers and Footers.
- Install and activate the plugin.
C. Add the Google Tag Manager Code
Once WPCode is activated:
- In your WordPress dashboard, navigate to Code Snippets → Header & Footer.
- Find the Header field.
- Paste the first Google Tag Manager code snippet into the Header field.
- Find the Body field.
- Paste the second Google Tag Manager (noscript) snippet into the Body field.
- Click Save Changes.
That’s it! WPCode will insert the snippets into the appropriate locations across your website.
Important: Don’t paste your Google Analytics G- Measurement ID into the WPCode header as a separate Google Analytics tracking script. We’re using Google Tag Manager to manage the Google tag, so the GTM container code is what belongs on the WordPress site.
D. Check That the Code Is Installed
After saving your changes:
- Open your website in a new browser tab.
- View the page source.
- Check that the first GTM snippet appears in the
<head>section. - Check that the noscript snippet appears just after the opening
<body>tag.
If you use a caching plugin or CDN, you may need to clear your cache before checking.
What’s Next? Test and Publish Your Google Tag Manager Container
At this point, you’ve created your Google Analytics account, property, and website data stream. You’ve also created your Google Tag Manager account and configured your first Google tag.
However, there are still a few things to do before everything is collecting data.
Your next steps are:
- Install the Google Tag Manager container code on your website.
- Use Google Tag Manager’s Preview mode and Google Tag Assistant to test your setup.
- Confirm that your Google tag is firing correctly.
- Return to Google Tag Manager and click Submit to publish your container changes.
- Check your Google Analytics Realtime report to confirm that website activity is being received.
Remember, creating your tags and saving them in the workspace is not the same as publishing them. Your changes need to be published before they become active through your live container.
Final Thoughts
Setting up Google Analytics and Google Tag Manager is an important part of building a business website.
Even if your website isn’t finished yet, you can create your accounts and prepare your tracking setup ahead of time. Once your website is ready, you can connect everything, test your tags, and start learning more about your visitors.
I recommend getting these tools set up early so you can begin understanding how people interact with your website as your business grows.
More Website 101 tutorials are coming to Monica Hacks!
If you found this guide helpful, check out the video tutorial below and subscribe to Monica Hacks for more beginner-friendly website tips.
