How to Add a Web Page to Google Analytics
Adding a new page to your website means you also need to make sure it’s being tracked in Google Analytics. This doesn't involve manually registering each new URL with Google, but rather ensuring the Google Analytics tracking script is present on that page. This guide will walk you through exactly how to do that, whether you're using a modern GA4 property, a simple HTML site, or a popular platform like WordPress.
How Google Analytics Actually Tracks a Web Page
Before diving into the steps, it helps to understand what's happening behind the scenes. Google Analytics tracks page views using a small piece of JavaScript code called a "tag" or "snippet."
You place this one snippet of code on your website, ideally within a header template that applies to every single page. When a visitor loads any page on your site, this JavaScript code runs automatically. It collects information about the visit (like browser type, the page's URL, and how the user got there) and sends it to your Google Analytics account as a "pageview" hit.
Therefore, "adding a page to Google Analytics" simply means checking and ensuring that this single JavaScript tag is running on your new page. If your website is set up correctly, your new pages should be tracked automatically without you having to do anything extra.
The latest version, Google Analytics 4, uses a snippet called the Google tag (gtag.js), which is what we will focus on in this tutorial.
Step 1: Find Your Google Analytics 4 Tracking Code
First, you need to locate your unique GA4 tracking code, also known as the "Google tag" or "Global Site Tag." You'll either need the full code snippet or just the Measurement ID, depending on the installation method you choose.
Here’s how to find it:
- Log in to your Google Analytics account.
- Click on the Admin gear icon in the bottom-left corner.
- In the Property column, make sure your correct GA4 property is selected.
- Click on Data Streams, then select your web data stream (it will usually be named after your website address).
- Under the "Google tag" section, click on View tag instructions.
- A new screen will appear. Click the Install manually tab.
Here you will see your Measurement ID (formatted like G-XXXXXXXXXX) at the top and the full JavaScript snippet below it. This is the code you will be adding to your website's pages.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [],
function gtag(){dataLayer.push(arguments),}
gtag('js', new Date()),
gtag('config', 'G-XXXXXXXXXX'),
</script>Step 2: Add the Tracking Code to Your Site
How you add this code depends entirely on how your website is built. We'll cover the most common scenarios, from the simplest HTML sites to complex Content Management Systems (CMS).
Method 1: Manually Paste the Code into HTML Files
If you have a basic website built with static HTML files, you'll need to edit the code directly. For Google Analytics to work correctly, the Global Site Tag must be placed immediately after the opening <head> tag on every single page you wish to track.
Simply copy the code snippet from Step 1 and paste it into the HTML of your new page. This method is straightforward but highly inefficient and prone to errors. If you have to do this for every new page, consider using a server-side include or template file instead so you only have to manage the script in one location.
Method 2: Use Google Tag Manager (Recommended)
Google Tag Manager (GTM) is a free tool that simplifies managing tracking codes on your website. Instead of adding many different scripts to your site's code, you add the GTM "container snippet" one time. Then, you can add, remove, and manage all your tags (like Google Analytics, Facebook Pixel, etc.) from the user-friendly GTM interface.
Once GTM is installed on your site, any new page that uses your site's template will automatically include the GTM container, and therefore any tags you've set up, like the GA4 tag. You'll never have to touch a line of code again to track a new page.
Here's how to set it up:
- From the GA4 "View tag instructions" screen, copy your Measurement ID (e.g.,
G-XXXXXXXXXX). - Go to your Google Tag Manager account and select your website’s container.
- Navigate to Tags and click New.
- Give your tag a clear name, like "GA4 - Configuration Tag".
- Click on Tag Configuration and choose the tag type Google Analytics: GA4 Configuration.
- Paste your copied Measurement ID into the Measurement ID field.
- Next, click on Triggering and select the All Pages trigger. This ensures the GA tag loads as early as possible on every page.
- Click Save. Finally, click Submit in the top-right corner of GTM, give your changes a version name, and press Publish.
Now, your GA4 tag will fire on every page of your site where the GTM container is installed, including any new ones you create.
Method 3: Using a Plugin for Your CMS
Most modern websites are built on a CMS platform like WordPress, Shopify, or Squarespace. These platforms make adding Google Analytics much easier by using plugins or built-in integrations, saving you from editing code manually.
For WordPress:
The easiest and best way to add Google Analytics to a WordPress site is with a plugin. This automatically adds the tracking code to all of your site’s pages, including new posts or pages as you publish them.
- Google Site Kit: This is Google's official plugin. Simply install it, connect it to your Google account, and select your Analytics property. It handles the entire setup with a few clicks.
- MonsterInsights: Another very popular plugin that offers a setup wizard and advanced tracking features.
- If your theme supports it, you might find an option in your theme settings (e.g., Appearance > Theme Options > Integrations) where you can paste your tracking snippet. Be warned: if you switch themes, you'll have to do this again.
For Shopify:
Shopify has a native integration for Google Analytics. Adding the code is easy and ensures it's placed on every page, from product pages to blog posts.
- From your Shopify Admin, go to Online Store > Preferences.
- Find the "Google Analytics" section.
- Click Manage pixel here.
- You may see a connection button, otherwise, follow Shopify’s instructions to paste in your Google Analytics tracking tag.
- Shopify takes care of placing the code correctly across your entire store.
For Squarespace, Wix, and Others:
Most hosted website builders have dedicated sections for marketing integrations. You typically won't need the full code snippet, just your Measurement ID (G-XXXXXXXXXX).
- Squarespace: Go to Settings > Marketing > Marketing Tools and use the "Google Analytics" integration.
- Wix: Go to Marketing & SEO > Marketing Integrations and connect to Google Analytics.
The process is similar for other platforms. Just look for "Integrations," "Marketing," or "Analytics" in your website's main settings panel and follow a few simple prompts.
Step 3: Verify That Your New Page is Being Tracked
After you’ve added the code, you must confirm that it's working properly. Don't just assume it works! Here are three easy ways to check.
1. Use the Realtime Report in GA4
This is the quickest way to see live data from your website.
- In one browser tab, open your newly published web page.
- In a separate tab, open your Google Analytics property.
- Navigate to Reports > Realtime.
- Within a minute, you should see yourself as an active user. You can also look at the "Views by Page title and screen name" card to see if the title of your new page appears in the list. Seeing your page title here is confirmation it's being tracked.
2. Use Your Browser’s Developer Tools
This is a slightly more technical but definitive method to see if the tag is firing.
- Go to your new web page in Google Chrome.
- Right-click anywhere on the page and select Inspect to open Developer Tools.
- Click on the Network tab.
- In the filter box at the top, type
collect. - Refresh your page. You should see one or more network requests appear with "google-analytics.com" in the name. This shows that your browser is successfully sending data to Google's servers.
3. Use the Tag Assistant Companion Extension
Google's own Tag Assistant Companion is a Chrome extension that verifies Google tags on your site. Once installed, simply browse to your new page. The extension icon will show a small number indicating the tags it found. You can click it to see detailed information, including whether your GA4 tag was detected and successfully sent data.
Final Thoughts
In short, adding a new web page to Google Analytics isn’t about adding URLs one by one, it’s about making sure your site’s master tracking code is included on that new page. Using a CMS plugin, theme template, or Google Tag Manager automates this process, ensuring every part of your website is measured correctly from the moment it's published.
Once you've confirmed that all your data is being collected in Google Analytics, the real work of analysis begins. Manually pulling reports and stitching together data from different sources to find insights can easily consume hours of your week. We built Graphed to remove that friction. After connecting your Google Analytics account in a few clicks, you can instantly build dashboards in plain English by asking questions like, "Show me my top landing pages by sessions for the last 30 days" or "Create a dashboard comparing Facebook Ads spend vs Google Analytics traffic by channel."
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?