Connect your website to Google Analytics 4

Pramodya Mendis
4 min readAug 24, 2023

--

Google Analytics 4 is an analytics service that enables you to measure traffic and engagement across your websites and apps. This post focuses on connecting your primary website to Google Analytics.

This post is written with straightforward actions including screenshots for beginners who like to integrate their website with Google Analytics by themselves. If you are an IT professional you can directly follow the Google documentation available here.

First, you need to log in to your Google account, Then to start with Google Analytics 4.0, you can go to this doc.

Create an Analytics account

You need to create an analytics account if you already don’t have an analytics account. You can skip this section and go to Create a new Google Analytics 4 property if you already have an account.

  1. Go to Google Analytics home page

If you haven’t created a Google Analytics account before, you need to click on Start Measuring under Welcome to Google Analytics.

If you already have an Analytics account and you want to create a new account, you can click on Admin on the left menu panel, and in the Account section, you can click on Create Account (Image 1).

Image 1: Create Account

You need to provide an Account Name and Configure data-sharing settings to control which data you need to share with Google. For this, you can go with default settings and later you can change it if necessary.

Image 2: Fill account details

Click Next to add the property to the account.

Create a new Google Analytics 4 property

If you are not continuing from creating a new Analytics account, go to Admin and select the account you want to use in the Account column go to Property column and click on Create Property.

Image 3: Create property

Enter the Property Name and select the reporting time zone and currency. Then click on Next.

Image 4: Fill property details

Select your Industry category and Business size and click on Next.

Image 5: Business details

Choose your business objectives and click on Create. When creating the property accept the Analytics Terms of Service and the Data Processing Amendment.

Image 6: Business objectives

In Start data collection, choose Web since we are going to get analytics of our website.

Image 7: Start collecting data for the web

Then it will open the Set up data stream panel, You need to enter your website URL and stream name as follows and then click on Create Stream.

Image 8: Set up data stream

Then it will open the Installation Instructions panel as follows:

Image 9: Installation instructions

This code tag is the Google tag for this account. Copy and paste it in the code of every page of your website, immediately after the <head> element. Don’t add more than one Google tag to each page.

Then you can go to the Analytics Home page and select the account you created, It will take 24 hours to reflect analytics data in your dashboard.

Image 10: Analytics dashboard

--

--