---
title: "Adding Google Analytics"
source: "https://docs.nexcess.com/software/kadence/add-google-analytics/"
description: "Google Analytics is a free web analytics service provided by Google that helps website owners and marketers track and analyze website traffic and user behavior.…"
vertical: "Software"
area: "Kadence"
date: "2020-11-10"
last_modified: "2026-07-02"
---

# Adding Google Analytics

Google Analytics is a free web analytics service provided by Google that helps website owners and marketers track and analyze website traffic and user behavior. This guide will outline a few different methods for adding Google Analytics to your site.

Set Up Google Analytics

Create an Analytics Account

If you don’t already have a **Google Analytics** account, you’ll need to create one:

1. Go to [https://analytics.google.com](https://analytics.google.com).
2. Sign in with your Google account (or create one).
3. Click “**Start measuring**”.
4. Fill in the **Account Name** (e.g. your business name).
5. Choose the **data-sharing settings** you prefer and click **Next**.

Set up a GA4 Property

1. Enter a **Property Name** (e.g., “My Website”).
2. Select your **time zone** and **currency**.
3. Click **Next**, then answer some basic questions about your business.
4. Click **Create** and accept the terms of service.

Set up a Data Stream

1. Choose your platform: Web, iOS, or Android. For a website, choose **Web**.
2. Enter your **website URL** and a **stream name**.
3. Click **Create Stream**.
4. You’ll now see your Measurement ID (looks like: G-XXXXXXXXXX) and the global site tag (gtag.js).

If you intend on using the custom snippet method, copy the global site tag code to your clipboard.

See [Google Analytics Help](https://support.google.com/analytics/answer/9304153?hl=en) for additional help and information.

Add Google Analytics to Your Site

Custom Snippet Method

```javascript
<!-- Example -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXXX');
</script>
```

Your site code should look something like the above Javascript example.

1. Copy the full site code snippet generated by Google. Make sure your Measurement ID (i.e. id=G-XXXXXXXXXX) is correct.
2. Use a plugin such as [Code Snippets](https://docs.nexcess.com/software/kadence/blocks/add-custom-filter-or-function-with-code-snippets/) to insert the site code snippet inside the <head> tag of your site.

Plugin Method: Site Kit by Google

Site Kit is the official WordPress plugin from Google.

1. Install the [Site Kit by Google](https://wordpress.org/plugins/google-site-kit/) plugin.
2. Activate the plugin.
3. Connect Site Kit to your Google Analytics Account.

For more detailed instructions, visit this [Site Kit Setup and Installation document](https://sitekit.withgoogle.com/documentation/getting-started/install/).

Plugin Method: MonsterInsights

MonsterInsights is one of the most popular Google Analytics plugin for WordPress.

1. Install [Google Analytics for WordPress by MonsterInsights](https://wordpress.org/plugins/google-analytics-for-wordpress/).
2. Activate the plugin.
3. Navigate to the Insights tab in your WordPress admin menu and configure the plugin.

For more detailed instructions on how to set up MonsterInsights, please see their [setup document](https://www.monsterinsights.com/docs/connect-google-analytics/).

Plugin Method: Flying Analytics

For enhanced performance, Flying Analytics copies the Google Analytics scripts to your local server.

1. Install the [Flying Analytics](https://wordpress.org/plugins/flying-analytics/) plugin.
2. Activate the plugin.
3. Navigate to Settings → Flying Analytics.
4. Add your Google Analytics Tracking ID (a.k.a. Measurement ID)
5. Save your changes.

Verify Google Analytics Tracking

1. Visit your site in a new browser tab.
2. Go back to [Google Analytics](https://analytics.google.com/).
3. Under **Reports → Realtime**, you should see your visit show up within a few seconds.

**Note:** you may need to log out of WordPress for your traffic to be recorded. Do not use an Incognito/private window or a browser with an ad blocker as this may block the Google Analytics script.

Related Documents

- [How to add a custom filter or function with Code Snippets](https://docs.nexcess.com/software/kadence/blocks/add-custom-filter-or-function-with-code-snippets/)
- [Adding Google Tag Manager with a child theme or code snippet plugin](https://docs.nexcess.com/software/kadence/add-google-tag-manager-with-a-child-theme/)
- [Common Code Snippets for Kadence Users](https://docs.nexcess.com/software/kadence/theme/common-code-snippets-for-kadence-users/)
