How to Set Up Google Analytics (GA4) for A Website – 4 Steps


how to set up Google Analytics

Summary: This post offers a step-by-step guide on how to set up Google Analytics for a website. Popular Google Analytics plugins for WordPress are also introduced if you want to use a plugin to effortlessly add Google Analytics to your website.

About Google Analytics

If you have built a new website and want to track and analyze your website’s data, you can use Google Analytics.

Google Analytics, first launched in 2005, is a free web analytics service developed by Google. It helps website owners track site traffic and is used for Google SEO and marketing purposes. It is an essential free Google SEO tool.

Google Analytics can be used to track various website activities, e.g., real-time traffic, landing pages, page views, unique page views, bounce rate, conversions, traffic sources, visitors’ behavior, and more. Over time, as it collects data, you can gain valuable insights that can guide your digital marketing strategy and help you achieve your online business objectives.

In 2023, Google Analytics 4 replaced the old Universal Analytics as the primary Google Analytics platform.

Related: 2024 Best Free Keyword Research Tools to Find Keyword Ideas

How to Set Up Google Analytics for A Website: Step-by-Step Guide

To use Google Analytics for your website, you need to sign up for a Google Analytics account, install a small piece of tracking code on your website, and configure your settings to match your specific needs such as setting up goals and conversion tracking. Check the detailed steps below.

Step 1. Create a Google Analytics Account

If you don’t have a Google Analytics account yet, you need to create one first.

  • Go to and use your Google account to log in. If you don’t have a Google account yet, you can click Create Account to create one.
  • After logging in, you can click the Start Measuring button to access the Google Analytics platform.

Step 2. Add Google Analytics Property

  • In Google Analytics, click the Admin button at the bottom-left to open the admin panel.
  • Click the Create button and select Property.
  • Enter the website name of your property, and select the reporting time zone and currency. Click Next.
  • Select the industry category and business size, choose your business objectives, etc.
  • Click Create and accept the Google Analytics Terms of Service Agreement to add your property to Google Analytics.
add a property in Google Analytics

Step 3. Add a Data Stream for Your Property

  • After you add a property, you can go to Property Settings > Data collection and modification.
  • Click Data Streams.
  • Click the Add Stream button.
  • Select Web if you want to set up Google Analytics 4 for a website.
  • Enter your website URL and stream name.
  • Click Create Stream to create a data stream.
  • Then it will show the web stream details including the stream ID, measurement ID, etc. Copy and save the measurement ID to a safe place in case you may need it in the future.
add a data stream for your website

Step 4. Install Google Analytics 4 on Your Website

To set up Google Analytics for your website, you need to install the global site tag (gtag.js) in the <head> section of the HTML of every page on your website.

  • Click the data stream you created.
  • In the “Web stream details” window, scroll down to select “Configure tag settings” under the “Google tag” section.
  • Copy your Google tag ID which starts with “G-“.
  • Enter your Google tag ID into the specified field that your CMS platform offers.
  • If your CMS doesn’t offer a field to enter your Google tag ID, you need to manually add the Google tag to your website by modifying the website’s HTML. Select “View tag instructions” under “Google tag”. Select Install Manually. Copy and paste the Google tag code into the code of every page of your website, immediately after the <head> element.
  • Then you can view your website’s traffic data in Google Analytics.
add Google tag to your website

Alternative Ways to Set Up Google Analytics for A Website

If you create a website with WordPress, you can also use a WordPress plugin to easily set up Google Analytics for your website without editing the code. Still, if you are not familiar with code editing, using a plugin may be a better choice. Popular plugins include Site Kit by Google, MonsterInsights, etc.

Add Google Analytics to Your Website with Site Kit by Google

Site Kit is the official plugin offered by Google that lets you not only set up Google Analytics but also set up Google Search Console, Google AdSense, Google PageSpeed Insights, etc. You can directly add these Google services from your WordPress dashboard.

Check the detailed steps below for how to set up Google Analytics for a website with Site Kit.

  1. Log into your WordPress dashboard.
  2. Click Plugins > Add New Plugin.
  3. Search for “Site Kit” via the search box.
  4. Click Install Now to install the Site Kit by Google plugin with one click.
  5. Click Activate to activate the plugin.
  6. Click the Start Setup button.
  7. In the setup screen, tick the option “Connect Google Analytics as part of your setup”. Then click the “Sign in with Google” button.
  8. Select the Google account that you want to use to set up Google Analytics for your website.
  9. Follow the on-screen instructions to verify your website ownership, and click Next when you arrive at the “Set up Google Analytics” screen.
  10. Select your GA4 account, property, and data stream you set up beforehand, and click the Configure Analytics button to install GA4 on your website.
set up Google Analytics with the Site Kit by Google plugin

Configure Google Analytics for a Website with MonsterInsights

MonsterInsights is another popular Google Analytics plugin for WordPress. It allows you to easily connect your WordPress website to Google Analytics in a few clicks. You can then track your website’s data and see how visitors find and use your website.

Follow the steps below to use MonsterInsights to set up Google Analytics for your website.

  1. Click Plugins > Add New Plugin in your WordPress Dashboard.
  2. Search for “MonsterInsights’ and install the plugin. Activate it.
  3. Launch the MonsterInsights setup wizard.
  4. Sign in with the Google account that is associated with your Google Analytics.
  5. Select the Google Analytics account and the property you want to track.
  6. Follow the on-screen instructions to set up Analytics for your website.


This post mainly introduces how to set up Google Analytics for a website. You can either manually add Google Analytics to your website or use a professional plugin to easily install Google Analytics (GA4) on your website. The detailed guides are included in this article, hope it helps.

author avatar

About the Author

James Young

James Young, has been a Google SEO expert for about 10 years. He has helped several companies achieve tens of millions of organic traffic per year in the past. He is talented in this area and tries to dig deeper into Google SEO and online marketing. He offers various SEO thoughts to help others rank higher in Google searches, gain more traffic, and build better websites.