Step-by-Step Guide to Adding a Website to Google Analytics

It isn’t rocket surgery to set up a Google Analytics Account, but anything new can feel daunting. Don’t worry, it isn’t hard and it’s completely worth doing, even if your site is small. Setting up GA4 will help you understand your website’s performance and give you the data to adjust your digital strategy as you interpret what is happening with users. Here are some step-by-step instructions.


Step 1: Account Creation

Create a Google Analytics Account:

  • Go to the Google Analytics website.
  • Click on “Start for free” or “Sign in to Analytics” if you already have a Google account.

Step 2: Property Creation

Set Up a Property:

Once logged in, click on “Admin” (gear icon) in the lower-left corner of the screen.

How to Add Google Analytics 2024
Click this little gear.

In the “Account” column, click on “Create Account.”

How to Add Google Analytics 2024

Enter an account name (e.g., your business or website name).

How to Add Google Analytics 2024

Select your preferences for data sharing (you can always change these later and the defaults are fine). Hit the blue “Next” button on the bottom of the page.

Enter the property name (e.g., your website’s name), select the reporting time zone, and currency.

How to Add Google Analytics 2024

Click “Next.”


Step 3: Business Details

Add Your Business Details:

How to Add Google Analytics 2024

Step 4: Business Objectives

Choose Your Business Objectives

This will determine which reports GA4 will automatically create for you. If you have multiple objectives, choose what is most critical to your success as a business.

How to Add Google Analytics 2024

Now, blindly accept the Terms of Service like I did, or read them like you’re some kind of bored lawyer with nothing better to do.

Google Terms of Service
I agree to give Google my soul.

Step 5: Start Collecting Data

Add Your Website Details:

Choose the type of platform you’re tracking (Web, Apps, or Apps and Web). For websites, select “Web.”

How to Add Google Analytics 2024

Enter your website’s URL and a stream name (e.g., “My Website”).

Set Up Data Stream

Add your website URL and give it a Stream Name

How to Add Google Analytics 2024

Hot tip: select as many tracking options as you are allowed to. You can always ignore or turn these parameters off if they are overwhelming, but, like in life, more data is better than less data. Even if you don’t have an experienced analyst or strategist at this point, when you need one, we are much happier when clients have historical data to dig through. And when you need one, please reach out. We are very, very happy to dig through your boring data for you.


Step 6: Set Up a Google Tag

Get the Tracking Code:

After creating the stream, you will see a block of code. I scribbled the details out so that hooligans don’t go horsing around with this site’s tracking and cause chaos.

How to Add Google Analytics 2024

Step 7: Copy and Paste Tracking Code

Click the copy button on the upper right-hand corner of the code Google provided.

how to add ga4 to website 2024
Here it is.

Add the Tracking Code to Your Website:

Paste the tracking code into the HTML of your website. Place the code immediately before the closing </head> tag on each page you want to track.

If you have a “header.php” file, add the code there so you don’t have to add it to each individual site page. Here’s an example:

How to Add Google Analytics 2024

Verify Tracking Code Installation:

Go back to your Google Analytics account to the window with the code. In the top right-hand corner, hit the “Test installation” button. If it doesn’t work, calm down. Give it a few minutes.

How to Add Google Analytics 2024

Congratulations! You did it, and you’re not even crying or swearing. I am proud of you. If you are crying or swearing, please reach out to us for help. We can do this quickly for you and you will save yourself the stress.

If this is how you feel, please reach out for help.

Additional Tips:

  • Google Tag Manager: For more advanced tracking and easier management, consider using Google Tag Manager to implement your Google Analytics tracking code.
  • Goals and Conversions: Set up goals in Google Analytics to track important actions on your website, such as form submissions, purchases, or page views.
  • Filters: Apply filters to exclude internal traffic or spam referrals to ensure your data is accurate.
  • Enhanced Tracking: Enable additional features like Enhanced Ecommerce tracking, site search tracking, or user ID tracking based on your website’s needs.

Screen captures: All screen captures are from Google.
Photo credit: all images were created by Mother Robot.

Leave a Reply