login Sign in with Google
How to Add Google Analytics to Your Website: A Step-by-Step Guide

How to Add Google Analytics to Your Website: A Step-by-Step Guide

Google Analytics is a powerful tool that allows website owners to track and analyze traffic. By integrating Google Analytics into your site, you can monitor visitor behavior, improve your marketing strategies, and enhance user experience. This tutorial will walk you through the process of adding Google Analytics to your website in a few simple steps.

Step 1: Create a Google Analytics Account

Before you can start tracking your website’s data, you need to create a Google Analytics account.

  1. Go to Google Analytics.

  2. Sign in with your Google account or create a new one if you don’t have one.

  3. Click on Start measuring.Welcome to Google Analytics

  4. Enter your Account Name (e.g., "MyWebsiteAnalytics").Enter your Account Name

  5. Configure account settings and click Next.

  6. Set up a property by entering your website name, selecting the time zone, and choosing the currency.Enter your website

  7. Click Next, then select your business category and business size.Describe your buisness

  8. Click Create and accept the Google Analytics Terms of Service.Accept terms

Step 2: Set Up a Data Stream

Google Analytics uses data streams to collect information from your website.

  1. Choose your platform: Web, Android app, or iOS app.Choose your platform

  2. If you select Web, enter your website’s URL.

  3. Name the stream (e.g., "My Website").

  4. Enable Enhanced Measurement (recommended) to automatically track page views, clicks, scrolls, and other interactions.Enable enchanced measurement

  5. Click Create & continue.

Step 3: Get Your Google Analytics Tracking Code

Once the data stream is created, you will receive a tracking code that needs to be added to your website.

  1. Copy the provided JavaScript code.Insert JS code

Step 4: Add the Tracking Code to Your Website

To start collecting data, you must add the Google Analytics tracking code to your site’s HTML.

For Static Websites:

  1. Open your website’s HTML file.

  2. Paste the tracking code inside the <head> section, before the closing </head> tag.Paste JS code in head

  3. Save and upload the updated file to your server.

For WordPress Websites:

If you're using WordPress, you can install the Google Analytics tracking code without editing HTML.

  1. Install the Site Kit by Google plugin.Here's how to set up the Google Site Kit WordPress plugin

  2. Activate the plugin and connect it to your Google account.

  3. Follow the on-screen instructions to link Google Analytics to your site.Follow instruction like the penguin

Alternatively, you can manually add the tracking code using a theme settings panel (if available) or a plugin like Insert Headers and Footers.

For Websites Using Google Tag Manager:

  1. Log in to your Google Tag Manager account.

  2. Select your container and go to Tags.Go to tags

  3. Click New and choose Google Analytics: GA4 Configuration.

  4. Enter your Measurement ID and configure triggering to fire on all pages.Enter measurement ID

  5. Save and publish the tag.

Step 5: Verify Your Google Analytics Installation

To ensure Google Analytics is correctly installed:

  1. Open your website in a new tab.

  2. Go to Google Analytics and navigate to Reports > Real-time.

  3. If you see active users, the installation is successful!Verify if it's working

You can also use the Google Tag Assistant Chrome extension to check if the tracking code is firing correctly.

Conclusion

By following these steps, you have successfully added Google Analytics to your website. You can now track visitor data, analyze performance, and optimize your site accordingly. Make sure to regularly check your Google Analytics dashboard to gain insights and improve your online presence.

GA4 is now configured