If you’re searching for how to install Google Analytics on a website, the process is easier than it might seem. Google Analytics 4 (GA4) lets you see where visitors come from, which pages they visit, how they interact with your content, and what actions they take.
That information can be useful for SEO, content marketing, and general website management. Instead of looking at traffic numbers alone, you can use GA4 to understand what’s working and where your website could do better.
The good news is that you don’t need to be a developer to get started. In this guide, we’ll walk through how to install Google Analytics on a website, from creating your GA4 property to adding the tracking code to WordPress and basic HTML sites.
Google Analytics is Google’s analytics platform for collecting and reporting data from websites and apps.
Once Google Analytics is connected to a website, it can collect information about how people interact with the site. The data can then be used to understand traffic, engagement, conversions, and other aspects of website performance.
GA4 can track a wide range of metrics and events, including:
The interesting part is that the data isn’t just useful for looking at how much traffic a website receives. It can also help answer more practical questions.
Which pages attract visitors? Where are users coming from? Are people actually engaging with the content? Which traffic sources bring visitors who take meaningful actions?
That’s where GA4 becomes useful for SEO and digital marketing.
You’ll need a Google Account to create and manage a Google Analytics property.
If you already use Gmail or another Google service, you can generally use that existing account. If you don’t have one yet, create a Google Account before starting the GA4 setup.
Once that’s ready, head to Google Analytics.
If you’re setting up Google Analytics for the first time, you’ll need to create an Analytics account before adding your website.
The basic process is:
Your Analytics account acts as the container for your properties. If you manage multiple websites or businesses, keeping that structure organized from the beginning can save you headaches later.
After creating the account, Google Analytics will ask you to create your first property.
A property generally represents the website or app whose data you want to measure.
Enter the following information:
Click Next.
Google will then ask for some additional information, including your industry category and business size. You’ll also be asked about how you intend to use Google Analytics.
Complete the relevant options and continue to create the property.
If this is your first time setting up Analytics, you’ll also need to accept the applicable Analytics Terms of Service and Data Processing Amendment.
Once the property has been created, you’re ready to connect your website.
GA4 uses data streams to collect information from websites and apps.
For a website, you’ll want to create a Web data stream.
Choose:
Add a data stream → Web
Enter your website URL and give the stream a recognizable name.
For example:
namabisnisku.comNama Bisnis Ku WebsiteYou may also see the Enhanced Measurement option.
This feature can automatically collect certain interactions, such as page views and other events, without requiring you to manually configure every event from scratch.
Review the setting and enable it if it makes sense for your tracking needs.
Then click Create stream.
Your web data stream is now ready.
Creating the property isn’t enough. Your website still needs a Google tag so GA4 can receive data.
From your Google Analytics property:
You’ll see a JavaScript snippet containing the Google tag, typically placed within the <head> section of your website.
That’s the code that connects your website with your GA4 property.
Now comes the part that matters: installing it correctly.
There are several ways to add the Google tag to a WordPress website. One straightforward option is using a plugin.
For this example, you can use the WPCode plugin to insert the tracking code into your site’s header.
After installing and activating WPCode:
That’s it.
The advantage of using a plugin is that you don’t have to edit your theme files directly. This can also make the setup easier for users who aren’t comfortable working with PHP or WordPress theme code.
After adding the code, return to Google Analytics and use the Test installation option under the manual installation instructions to verify that everything is working.
If you’d rather avoid another WordPress plugin, you can also add the tracking code directly to your theme.
From the WordPress dashboard:
header.php file.</head> tag.Afterward, use Test installation in Google Analytics to check the connection.
One thing to keep in mind: directly modifying a theme file can create maintenance issues when the theme is updated. If you’re using this approach, make sure you understand how your WordPress theme handles custom changes.
Running a website without WordPress? That’s fine. GA4 can also be installed manually on a traditional HTML website.
You’ll need access to your website’s files, either through your hosting control panel, file manager, FTP client, or another method provided by your hosting company.
Find the HTML file you want to track.
For many basic websites, this might be:
index.html
Open the file and locate the <head> section.
Paste the Google Analytics tag inside the <head> section, then save the file.
A simplified structure will look like this:

One thought on “How to Set Up Google Analytics (GA4) on Your Website”