3 Ways to Install and Setup Google Analytics 4 / GA4 to your website

To understand how well your website is doing, you can use a tool called Google Analytics-4. It helps you see things like how many people visit your site and where they come from. Learn how to setup Google Analytics 4 

Setup Google Analytics 4

But before you can see all that info, you Setup Google Analytics 4 on your website. There are three ways to do it:

  1. Use the basic GA4 tracking code (GTAG or Google Tag).
  2. Use Google Tag Manager.
  3. Use a plugin that easily integrates with GA4.

Table of Contents

1. Setup Google Analytics 4 Property and Set Up a Data Stream

It all begins with setting up a new property.

To create a setup Google Analytics 4 property, navigate to the Admin section in your Google Analytics interface by clicking on “Admin” at the bottom-left corner. Then, in the Property section, click on “Create Property.”

Note: If you haven’t used GA before, visit analytics.google.com and follow the steps to create your first property.

Setup Google Analytics 4

Then enter the name of your property. It might be the name of your website, your company, a brand, etc. Choose your company’s country, reporting time zone, and the main currency your business operates.

Setup Google Analytics 4

Next, proceed to answer a series of questions. Following this, you’ll be required to specify your business objectives. The selection made here will influence the reports visible in the interface. For simplicity at this stage, opt for obtaining baseline reports.

Setup Google Analytics 4

Select the “Create” option.

The subsequent task involves setting up your initial data stream, which serves as the data source responsible for transmitting events to your Google Analytics 4 property. It is possible to have several data sources within a singular property. For instance, you might have three web properties, one for an Android app, and one for an iOS app.

For the purposes of this blog post, emphasis will be placed on a Web stream. Choose this option.

Setup Google Analytics 4

Then enter the URL of your website (for example, https://www.mywebsite.com). Note that the protocol (https) is already selected. After that, enter the name of your website.

When you create a web data stream in Google Analytics 4, you can enable/disable Enhanced Measurement. It is designed to help marketers get as many events in the reports as possible without the need to cooperate with developers or configure them in Google Tag Manager.

Setup Google Analytics 4

This functionality is activated by default and will autonomously record the subsequent events:

  • Page view (event name: page_view)
  • Scroll (event name: scroll)
  • Outbound link click (event name: click with the parameter outbound: true)
  • Site search (event name: view_search_results)
  • Video Engagement (events: video_start, video_progress, video_complete)
  • File Download (event name: file_download)
  • Form events (form_start, form_submit)

If desired, you have the option to enable or disable events individually. This can be accomplished by accessing the Enhanced Measurement section, clicking on the gear icon, and then toggling the respective buttons.

When you’re ready, press the Create stream button.

Setup Google Analytics 4

2. Setup Google Analytics 4

Three types of setup Google Analytics 4 are available, and the choice depends on your website and context:

  • Install GA4 using a Google Analytics plugin/integration.
  • Install GA4 with GTAG (also known as Google Tag or native GA4 tracking code).
  • Install GA4 using Google Tag Manager.

You must select one of these options based on your specific needs and circumstances.

2.1. Setup Google Analytics 4 with a plugin

This presents a favorable choice for widely-used content management systems equipped with inherent GA4 support or GA4 plugin compatibility. Notable examples of such platforms include WordPress, Squarespace, Shopify, Magento, and others.

Given the diverse nature of platforms and their varied functionalities, it is crucial to conduct research to ascertain whether they inherently support Google Analytics 4. In cases where native support is lacking, it’s worth exploring the possibility of utilizing third-party plugins compatible with your system.

For wordpress you can connect GA4 but installing this plugin known as “Site Kit by Google”

Once you find the instructions, follow them and you should be good.

For example, on WordPress, there are various plugins that offer GA4 integration, like GA4WP. After you install the plugin, it will ask you to enter the Measurement ID.

This refers to the measurement ID. Simply copy it and paste it into the settings of the plugin, then save the changes. With that, you’ve completed the process! The subsequent step involves testing, and the details on how to do so will be explained here.

2.2. Install Google Analytics 4 with the native tracking code

If you’re dealing with a website that lacks native GA4 integration or doesn’t accommodate GA4 plugins, you can request the developer to directly install the native GA4 tracking code into the website’s source code.

Navigate to GA4 Admin > Data Streams and choose your Web Data Stream. From there, click on “View tag instructions.”

Then select Install manually and copy the code that you’ll get:

Provide the code to your developer and request them to install it in the <head> section of all pages on your website. A developer should be familiar with this procedure.

2.3. Install GA4 using Google Tag Manager

If you desire greater flexibility and control over managing tracking codes, the third installation option (Google Tag Manager) is the solution. To begin, you need to install Google Tag Manager on your website.

Following that, navigate to GA4 > Admin > Data Streams, choose your web data stream, and copy the measurement ID.

Next, access your Google Tag Manager container (if you’re new to it, refer to a tutorial on getting started) > Tags > New, and opt for Google Tag.

In the Tag ID field, input the ID you copied from the GA4 interface.

In the Triggering section, choose Initialization – All Pages and assign a name to the tag, such as “Google Tag.”

Now, proceed to test the setup. Click on “Preview” located in the top right corner of the Google Tag Manager interface.

After enabling the preview mode, you should observe the new Google tag listed among the tags that have been fired.

The subsequent step involves verifying whether data is visible in Google Analytics 4. I will elaborate on this aspect in the upcoming section of the blog post. Following that, you will be required to publish the changes.