How to set up and install Google Analytics
In this tutorial, I will explain how to create and install Google Analytics on a website, using Tag Manager and not. If you have a website running on WordPress, Wix, Squarespace, or Webflow, and you want to set up Google Analytics, this guide is for you. At the end, you will find ideas on how to better structure your Google Analytics properties and basic adjustments I usually make for any website.
In case you don’t have Google Tag Manager installed on your website, I highly recommend you start with this guide first. GTM will make managing your tracking setup much easier.
Create a Google Analytics account
In case you are creating your very first Google Analytics account, simply go to https://analytics.google.com and click Start measuring:

If you already have an account and need to create a new one, then in the Google Analytics interface, go to Admin by clicking the cog icon in the bottom left corner, and click the Create button:

The creation process itself doesn’t take more than a minute. All the steps are shown below:







Probably, the most important thing here is to ensure you set the reporting time zone right. Either choose the time zone of your physical location or use the time zone from where most of your traffic comes. As I usually manage Google Ads campaigns for my clients, I ensure that the Google Analytics timezone aligns with the one I set in Google Ads.
But overall, there is nothing that cannot be changed later on, so don’t overthink what you put during the Google Analytics creation process. If in doubt about what information to enter, see the screenshots above.
Basically, during the creation phase, we:
- Create an account and give it a name.
- Create a property and select the reporting time zone and currency.
- Add business details: category and size (used for benchmarking purposes).
- Select business objectives (used for personalized reports).
- Create a data stream with your measurement ID (G-XXXXXXXXXX).
After everything is created, Google will identify the CMS you are using and show you options on how to install the Google tag:

I usually close this screen and go back to the stream details. Where to find your data stream? Go to the the Admin section (click the gear icon), then: Property settings → Data collection and modification → Data streams:

Click there and you will see your data stream:

Now click on the data stream, and you will get to the stream details, where you will find your Measurement ID and a bunch of other settings:

Install Google Analytics using Google Tag Manager (any website, recommeded)
This Google Analytics implementation method doesn’t depend on the platform your website is running on. Be it WordPress, Wix, Squarespace, Shopify, or anything else. There might be several nuances, but in general, if you have a Google Tag Manager code installed on your website, you are good to install Google Analytics with it. And if you don’t, see this guide on how to create and install it.
Create a Google Tag
I know, a lot of tags in the headline. In Google Tag Manager, in the Tags section click New:

Click on Tag Configuration and select Google Analytics → Google Tag:

Now go to your Google Analytics data stream, copy the measurement ID (G-XXXXXXXXXX) and put it to the tag ID field in the tag configuration:

The default trigger for a Google Tag is Initialization – All Pages; leave it as is. It means that your Google Analytics tag will fire as early as possible on every page. Click save
Check if Google Analytics is working
After you create the Google Tag, click the Preview button:

This will launch the Google Tag Manager preview mode and you will be prompted to enter your website URL:

Once you click Connect, two new tabs will open: Tag Assistant and the website’s URL.

Here we see the summary for Google Tag Manager tags and that our Google Tag fired, which is good. Now, if we switch to the Google Analytics summary by clicking G-XXXXXXXXXX in the filter bar at the top, we can see what Google Analytics has captured, which is a Page View event:

Check if Google Analytics is working using DebugView

In the Google Analytics Admin section, go to Data display → DebugView. Here you should see the events that were sent from your preview session:

Here you can click on a certain event and see the event details. One thing I usually do is check the page location to see whether it matches my actual page URL:

Keep in mind that DebugView is often buggy and it can take eternity for you to see the events.
Check if Google Analytics is working using DevTools
This method of checking is the fastest and the most robust. Simply go to the Network tab, type in the search box collect or your measurement ID, and here you will see all the information that has been sent to Google Analytics:

By the way, you can do this to check any event on any website, regardless of whether the preview mode is enabled or not. This method is not limited to Chrome. In Safari, it’s fairly similar.
Check if Google Analytics is working using realtime reports

Go to Reports → Realtime overview to see all of the current visitors to see your session.
Publish the changes
Once you ensure that Google Analytics is working, publish the new version in Google Tag Manager by clicking the Submit button in the upper right corner. You can give it a name. After publishing, the Google Tag will become live, and Google Analytics will start collecting data.
Install Google Analytics on WordPress
If you want to use a plugin
In case you don’t want to bother with Google Tag Manager and you want a simple plug-and-play solution, which, by the way, is recommended (and developed) by Google, check out the Google Site Kit plugin:

Once the plugin is installed, you will need to authorize it using your Google account and pick your property:

Simple as that. As a nice little bonus, it will automatically verify and add your website to Google Search Console. It’s hard to mess up the installation using this plugin.
If you don’t want to use a plugin
First, go to Admin → Data collection and modification → Data streams and open your data stream. Then, scroll to the bottom and click on View tag instructions.

It will show you what installation methods are available based on what Google has scanned. Since we want the hard-coded option, select the Install manually tab, and you will get the code snippet to add to your website’s source code:

Ideally, this code should go right after the opening section, but it will work regardless of the position. The higher it is positioned in the source code, the better, as it will load the tracking code earlier. Now, as we have the code, let’s go to the WordPress dashboard.
In the Appearance settings open Theme File Editor and in the right sidebar find the Theme Header file (usually it’s called header.php):

Find where the opening <head> tag is and put your Google tag code right after it. Yeah, I’m lazy, and I’m reusing the screenshot from another post on Google Tag Manager. Please don’t judge me.
Install Google Analytics on Wix
Wix natively supports Google Analytics integration, so you don’t need to put in any codes. Open the Wix dashboard and go to Settings (left menu). Then, scroll to the bottom and open Marketing Integrations which is in the Development & integrations section:

Click Connect in the Google Tag card:

Add your measurement ID (G-XXXXXXXXXX) and click Save:


Now Wix will take care of everything. Keep in mind that Wix is extremely peculiar when it comes to tracking. Okay, I’m putting it overly nicely. Wix is the worst platform when it comes to tracking implementation. Just a heads-up.
Install Google Analytics on Squarespace
Squarespace is a fairly simple one. Go to the dashboard and open Settings (a gear icon):

Then, select Developer Tools → External API Keys, and here you will find the input field where you put your measurement ID (G-XXXXXXXXXX):

Save the changes, and you’re good.
Install Google Analytics on Webflow

Go to the Webflow dashboard and select Apps & Integrations in the left menu. Here you will find the measurement ID field. Enter your ID, click save, and publish the changes.
Google Analytics account structure
Now let’s go back the theoretical part, as I want to focus on the structure Google Analytics uses. There are three structural entities in Google Analytics:
- Account: a folder with properties, basically.
- Property: a website or a group of websites, or a combination of a website and an app.
- Data stream: a data entry point or a data channel: web / iOS / Android.
- Property: a website or a group of websites, or a combination of a website and an app.
How to structure things in Google Analytics
If you are setting up Google Analytics for a single company that you own or work for, chances are you will be dealing with a 1-1-1 structure, meaning: 1 account, 1 property, 1 data stream.
If you are setting up Google Analytics for different companies that have nothing in common except you as the Google Analytics person, you want each business to have its own account. Otherwise, user management becomes a mess.
Now, let me clarify the concept of a data stream. Unless you’re dealing with a multi-platform app, you don’t need more than one stream. You might be wondering, how am I supposed to track a multi-domain setup? The answer is with a single data stream. You don’t need separate data streams for different websites.
Cross-domain tracking
Okay, since we are on that topic, a common question is whether it’s better to create separate properties for each website or not. It depends on whether these websites are interconnected or not. Let’s imagine a company that owns Website A and Website B.
If the websites are interconnected, and users from Website A are supposed to visit Website B and vice versa, you should use the same property for both. Otherwise, you’d better keep them in separate properties.
But in both cases, you don’t need more than one data stream.
Google Analytics basic setup
In this section, I’m going to highlight two quick Google Analytics tweaks that I usually do when implementing Google Analytics for my clients.
Customize enhanced measurement
Google Analytics 4 tracks not only page views and sessions but also plenty of other events right out of the box. Some of them do not work well; some of them do not make sense to me.

Here is where you can find the settings for these auto-tracked events (click the gear icon) and you will see all extra events that will are tracked by GA:

Disable scroll tracking
Scrolls is an event type the benefit of which is not clear to me. I would rather track specific element visibility rather than the scrolling threshold on every page. It’s also rather annoying on short pages to have the scroll event fired automatically when the whole page is in the viewport.
Disable form interactions
At first, it might look cool: automatic form submission tracking. In reality, due to how differently each form is coded, this event either doesn’t work or, what I see more often, sends a lot of false positive events that are polluting your reporting.
Change data retention period

Go to Admin → Property settings → Data collection and modification → Data retention. Here, you will find the event data retention period setting and the user data retention setting.
By default, Google Analytics stores the event data for 2 months, which means any of your custom reports will be limited only to the last two months of data. You can change it to store data for 14 months. Even if you do not use or do not plan to use custom reports, believe me, it will come in handy once you decide otherwise.
What next
Double-check the reports in Google Analytics
Usually, after I set up a new Google Analytics property, I revisit it in a day or two and check the reporting to see whether everything is in place and the data in the reports look normal.
Set up key event tracking
After you have created and installed Google Analytics on your website, it’s time to take your tracking to the next level by measuring what actually matters: conversions, or, as they are called now in Google Analytics, key events. These are usually form submissions or purchases. In rare cases, you might want to track other less important but insightful events, like form views. Here you will find an article on how to track element visibility with Google Tag Manager. More articles on Google Analytics are coming, so stay tuned.
Set up 404 report
I’ve just updated my tutorial on how to create a 404 report in Google Analytics. Make sure to preconfigure your report beforehand, so it collects the data from day one.

Hi! I’m Roman, a Google Ads freelancer. This is my website where I share all kinds of things I find interesting related to Google Ads, Google Tag Manager, and Google Analytics. I am also available for hire, so if you need help with any of these, feel free to get in touch.