---
title: "How to Set Up Google Analytics to Track Your Website"
description: "Use this guide to learn how to set up Google Analytics to track WordPress, Wix, Squarespace, HubSpot, Shopify, Weebly, and custom-built websites."
image: "https://images.ctfassets.net/lzny33ho1g45/how-to-set-up-google-analytics-p-img/41881a8bf453beebc0f5900eb2df4797/file.png"
---

# How to Set Up Google Analytics to Track Your Website

Use this guide to learn how to set up Google Analytics to track WordPress, Wix, Squarespace, HubSpot, Shopify, Weebly, and custom-built websites.

[Google Analytics](https://zapier.com/blog/ga4-vs-universal-analytics) is a powerful tool for measuring your website's performance, but if you've never used it before, setting it up to track your website isn't exactly the most intuitive process.

In this tutorial, we'll explain how to add Google Analytics to WordPress, Wix, Squarespace, HubSpot, Shopify, Weebly, and custom-built websites.

## How to Get a Google Analytics Tracking Code

The first step in setting up Google Analytics to track your website is getting a tracking ID: a unique identifier used to associate your website with your Google Analytics profile.

To get a tracking ID for your website, navigate to the [Google Analytics home page](https://analytics.google.com/analytics/web/) and click the _Sign up_ button.

Select _Website_, and name your account. If you only plan to track one property, your website's name should be fine. If you plan to track multiple properties, you may want to use your own name or business name. Next, fill in the other requested details.

Read through the data sharing options and uncheck any that you're not comfortable with. When you're finished, click _Get Tracking ID_.

Read through the data sharing and terms of service agreements, check the boxes to agree to the terms, and click _I Accept_.

Once you've done that, Google Analytics will provide your tracking ID, as well as some code you may need to add to your website to set up Google Analytics tracking. Make sure to keep this window open; you'll need it for the next step.

## How to Add Google Analytics to Your Website

The method you'll use to add Google Analytics tracking to your site will depend on the platform you used to build your site. Use these links to jump to the instructions for your site's platform:

- [Custom site](#custom)
- [WordPress](#wordpress)
- [Wix, Squarespace, or HubSpot](#wix)
- [Weebly or Shopify](#weebly)

### How to add Google Analytics to a custom website

If you have a custom-built website with a team of developers who manage your site, you can send your developers the code that displayed in the _Global Site Tag_ section after you created your Google Analytics account.

They'll add it to the global code that appears on every page of your site somewhere between the `<head>` and `</head>` tags.

To validate the change, navigate to any page of your website, right-click somewhere on the page, and select _View Page Source_. In the page source view, click `Control` + `F` (Windows) or `Command` + `F` (Mac) to open the search function, type `</head>`, and tap enter. Then scroll up from the highlighted `</head>` tag and make sure your Global Site Tag displays.

You can test it the same way on multiple pages if you want to make sure the code appears on every page. As long as it does, Google Analytics can track your site.

### How to add Google Analytics to WordPress

If your site is built on WordPress, you can use a plugin to add your Google Analytics tracking code to every page of your WordPress site.

There are multiple plugins to choose from, but we've used the free plugin [Google Analytics Dashboard for WP](https://wordpress.org/plugins/google-analytics-dashboard-for-wp/). It makes it easy to add your tracking code and adds a Google Analytics dashboard to your WordPress dashboard so you can see some of your site's analytics without even leaving WordPress.

To install Google Analytics Dashboard for WP, sign in to your site's WordPress instance, hover over click _Plugins_, and click _Add New_.

In the search bar, type `Google Analytics Dashboard for WP`. When you see the plugin in the results, click _Install Now_.

When the plugin finishes installing, click _Activate_. This redirects you to your list of installed plugins.

Now, on your list of installed plugins, look for Google Analytics Dashboard for WP, then click the _Settings_ link below it.

On the settings page, click _Authorize Plugin_.

Click _Get Access Code_.

Sign in to the Google account you used to sign up for Google Analytics, and click the _Allow_ button to grant the plugin access to your Google Analytics data.

Copy the provided access code.

Navigate back to WordPress, paste the tracking code into the _Access Code_ box, and click _Save Access Code_.

The plugin automatically adds the Google Analytics tracking code to all pages of your site and shows you Google Analytics data on your WordPress dashboard.

### How to add Google Analytics to Wix, Squarespace, or HubSpot

If you use Wix, Squarespace, or HubSpot, Google Analytics tracking is a built-in function of the platform. You just need the tracking ID you got when setting up your Google Analytics account.

Once you have your tracking ID:

- Follow [these instructions](https://support.wix.com/en/article/adding-your-google-analytics-tracking-id-to-your-wix-site) to set up Google Analytics tracking in Wix.
- Follow [these instructions](https://support.squarespace.com/hc/en-us/articles/205815608-Using-Google-Analytics-with-Squarespace) to set up Google Analytics tracking in Squarespace.
- Follow [these instructions](https://knowledge.hubspot.com/articles/kcs_article/cos-general/add-your-google-analytics-code-to-your-hubspot-pages-or-blog) to set up Google Analytics tracking in HubSpot.

After you enter your tracking ID, each platform automatically adds your Google Analytics tracking code to every page of your website.

### How to add Google Analytics to Weebly and Shopify

Weebly and Shopify have sections in their admins where you'll paste your Global Site Tag code to add the tracking code to each page of your site.

First, you'll need to copy the Global Site Tag code that displayed after you created your Google Analytics account:

Next, follow the instructions below to add the code to Weebly or Shopify:

- [Add Global Site Tag to Weebly](https://www.weebly.com/app/help/topics/google-analytics)
- [Add Global Site Tag to Shopify](https://help.shopify.com/en/manual/reports-and-analytics/google-analytics/google-analytics-setup#step-3-enable-google-analytics)

After you save your changes, the CMS will automatically add your Google Analytics tracking code to every page of your website.

## How to Add Additional Websites to Google Analytics

If you have more than one website you want to monitor in Google Analytics, you can add those websites to your account so you can switch easily between all of them.

To add additional properties to Google Analytics, open Google Analytics, and click the _Admin_ tab.

Click _+ Create Property_.

Fill out the details, and click _Get Tracking ID_ to get the code you'll need to add to your other websites to track them in Google Analytics.

Once you've added your tracking code to each of the websites you want to track in Google Analytics, you can switch easily between them by clicking the dropdown next to the Analytics logo.

---

It takes a few days for Google Analytics to start showing data for a website after you create an account and add the tracking code, so don't panic if you don't see data immediately. After a few days, you should be able to log in to Google Analytics and start measuring your site's performance.

**Ready to learn more about Google Analytics?** Check out our guide on [turning your Google Analytics data into actionable tasks](https://zapier.com/blog/google-analytics-tips/), or connect Google Analytics to the other applications you use with [these Google Analytics Zapier integrations](https://zapier.com/apps/google-analytics/integrations).