How to Setup Google Analytics 2024 written on a light blue background in black text, accompanied by an illustration of a person surrounded by charts, graphs, and gears, symbolizing data analysis.

Measuring your website's performance is crucial for ensuring it attracts visitors. Google Analytics data can help you determine what is or isn’t working effectively.

There are two ways to set up Google Analytics 4 (GA4): the traditional and most common setup method is through a GA4 tracking code, and the other method is by using Google Tag Manager. You can find a tutorial on setting up Google Analytics using Google Tag Manager in 2024 here. In this guide, we'll focus on setting up GA4 in the traditional way, using a tracking code.

The first step is to create a GA4 property and data stream. In the bottom left corner of analytics.google.com, you'll find a gear icon that takes you to the admin page. Click on the blue plus icon and then select "Property" from the dropdown menu.

Note: If you've never used Google Analytics before, visit analytics.google.com and follow the steps to create your first property.

Next, give your property a name. Many people choose the name of their company, brand, or website. Then, select your property's main time zone and currency. Click "Next" to proceed.

You'll be asked to select your business objectives. We recommend choosing “Get Baseline Reports” as other options may alter the data interface. Baseline reports offer simplicity and a wide range of data sets.

Click "Create" to continue.

Now, you need to configure your first data stream. Google Analytics can track data from three main sources: Web, Android App, or iOS Apps. For this tutorial, we'll select Web.

Enter your website's URL (e.g., https://www.example.com). Note that HTTPS is already selected. Give this data stream a name, such as your company's brand or website name, unless you plan to have multiple data streams in your property. You'll also be asked if you want to use Enhanced Measurement, which predicts events on your site to improve data accuracy. For example, Enhanced Measurement might create unique events for specific forms on your website. We recommend leaving Enhanced Measurement on, but you can toggle it off if needed.

Once your Property is set up, you'll need to add your analytics tracking code to your website's codebase. To locate your code, click the gear icon in the bottom left corner, navigate to "Data collection and modification," and select Data Streams. Find your property, scroll down to "Google Tag," and then click on “View Tag Instructions.”

If you're using a CMS such as WordPress or Wix, you can choose your platform and follow the specific instructions for those CMS platforms. Alternatively, you can manually install your analytics code. You'll find code that looks like this: <!-- Google tag (gtag.js) -->. Copy the entire code box and paste it into the code of every page of your website, immediately after the <head> element. Avoid adding more than one Google tag to each page.

Following these steps ensures that your website is properly configured to collect and analyze data using Google Analytics. By implementing these measures, you can make informed decisions to optimize your website and enhance the user experience for your visitors.