How to Install Google Tag Manager on Your Website?

Danny · August 12, 2026 · 4 min read · Updated August 13, 2026

This article walks through installing and configuring Google Tag Manager: creating an account, adding the two code snippets to your site (with WPCode on WordPress), configuring the GA4 tag, verifying data with Tag Assistant, and submitting the configuration for publishing, in 27 steps with screenshots.

Google Tag Manager (GTM) lets site owners deploy and manage tags like Google Analytics and Google Ads without touching code. For a standalone site, tracking is the foundation of marketing decisions. Once GTM is in place, adding tracking codes, events, and conversion goals all happens in the dashboard.

Here’s the full walkthrough video:

YouTube: How to install and configure Google Tag Manager (GTM)

Install the GTM code

First, get GTM’s code onto your site: create the account, copy the snippets, insert them with a plugin, and test.

Step 1: Search for GTM

Log in with your Google account and search for Google Tag Manager.

Install google tag manager step 1-search gtm

Step 2: Create an account

Click the Create account button in the top right to create a new GTM account.

Install google tag manager step 2-Create Google Tag Manager account

Step 3: Add a new account

Fill in the account name, country, container name, and platform type. For a website, choose Web as the platform.

Install GTM step 3-Add a new Google Tag Manager account

Step 4: Accept GTM’s terms of service

Accept Google Tag Manager’s terms of service.

Install GTM step 4-Agree to Google Tag Manager terms of service

Step 5: Get your installation code

Google Tag Manager gives you two snippets to add to the head and body of your site. It’s simpler than it sounds; here’s how it works on WordPress.

Popup displaying Google Tag Manager installation code

Step 6: Install the WPCode plugin

In the WordPress admin, add a plugin called WPCode.

Search WPCode plugin in WordPress backend

Step 7: Add the code to header and body

After installing WPCode, open Code Snippets, then Header & Footer, and paste the two GTM snippets into the Header and Body sections on the right. Save when done.

Adding code to header and body sections for Google Tag Manager installation

Step 8: Test the installation

Back in Google Tag Manager, click Test. A green checkmark on the left means the code was added successfully.

Testing website after adding Google Tag Manager code

Configure the GA4 tag

With the code in place, configure the GA4 tag in GTM, connecting the data stream you created earlier.

Step 9: Add a new tag

Click New to add a tag.

Creating new tags in Google Tag Manager

Step 10: Name the tag

Name the tag and click Tag configuration.

Naming a tag and selecting tag type in Google Tag Manager

Step 11: Select the tag type

Choose the tag type and click Google Analytics.

Selecting Google Analytics as the tag type in Google Tag Manager

Step 12: Select Google Tag

Choose Google Tag under Google Analytics.

Configuring Google Tag in Google Tag Manager for Google Analytics

Step 13: Enter the tag ID

Find the Tag ID (the Measurement ID) in GA4 and enter it in GTM. If you haven’t created GA4 yet, see this guide on creating a GA4 data stream. How to locate the ID is in the next step.

Filling in the tag ID in Google Tag Manager

Step 14: Find the tag ID in GA4

If you just created GA4, click Start collecting data in the last step and select your website.

Navigating to Google Analytics website

If GA4 already exists, log in and click the gear icon in the bottom left to open Admin.

Logging in to Google Analytics 4 (GA4)

Click Data streams, and your website appears on the right; click it.

Accessing Data Streams in Google Analytics 4

In Web stream details, copy the MEASUREMENT ID and paste it into GTM’s Tag ID field.

Viewing Web Stream details in Google Analytics 4

Step 15: Set the trigger

Back in GTM, click Triggering.

Clicking the Triggering option in Google Tag Manager

Step 16: Choose Initialization – All Pages

Select Initialization – All Pages. This is the basic setup for connecting GA4 through GTM and collects all regular behavior data as visitors browse.

Choosing Initialization - All Pages trigger in Google Tag Manager

Step 17: Save

Save the GA4 initialization configuration.

Saving the configuration in Google Tag Manager

Verify the data is flowing

Before publishing, verify the configuration with preview mode and Google Tag Assistant to confirm data is actually being collected.

Step 18: Preview

Preview the configuration live to see if it works.

Previewing the settings in Google Tag Manager

Step 19: Connect Google Tag Assistant

Click Connect to link Google Tag Assistant to your website.

Popup to connect Google Tag Assistant to the website

Step 20: Connecting

It shows connecting; wait a moment.

Connecting Google Tag Assistant to the website

Step 21: Connected

When it shows Connected, the connection is live. Maximize the site preview window.

Google Tag Assistant successfully connected

Step 22: Browse your website

Browse your site and click around; a Tag Assistant connected notice appears at the bottom right.

Clicking items on the website for testing

Step 23: View activity in Tag Assistant

Back in Google Tag Assistant, the left panel records the browsing activity you just did.

Google tags found on the website

Step 24: View activity in GA4

Log in to GA4, click the gear icon in the bottom left, choose DebugView, and you’ll see the same activity. That confirms the GA4 initialization works.

Viewing GA4 DebugView in Google Analytics

Submit and publish

After verification, submit the configuration for publishing.

Step 25: Submit

Back in GTM, click Submit to send your configuration.

Submitting changes in Google Tag Manager

Step 26: Publish

Name this configuration and add a short description so you can recognize it later.

Publishing the configuration in Google Tag Manager

Step 27: Configuration summary

After publishing, a configuration summary shows the details of this setup.

Viewing the version summary in Google Tag Manager

GTM is now installed and connected to GA4. Events and conversion goals can be added from the GTM dashboard from here on, without touching the site code. With behavior data in place, combine it with Search Console indexing data and the data loop for your site is complete.

More guides like this,
every Thursday.

Hosting reviews, builder comparisons, performance tips, and plugin picks — curated weekly for WordPress site owners and builders.