# Connect Google Analytics

## Creating a free google analytics account:

To get started with Google Analytics, you'll need to create a free account. Follow these steps to sign up:

1. Go to the Google Analytics website: <https://analytics.google.com/>.
2. Click on the "Sign in" button in the top-right corner.
3. If you already have a Google account, sign in with your credentials. Otherwise, click on "Create account" to make a new Google account.
4. Follow the prompts to set up your account. Make sure to choose the correct options for your website or app.

## Obtaining your google analytics code:

Once you have your Google Analytics account set up, you need to get the tracking code for your website. The tracking code is a piece of JavaScript that you will need to add to your website's HTML to start tracking visitors and their behavior. Here's how to find your tracking code:

1. After signing in to your Google Analytics account, click on the "Admin" option in the lower-left corner of the page.
2. On this screen there will be a search bar at the top of the page. Start typing "Tracking" into the search bar and your tracking code (or "measurement ID") will show up as a search preview. Copy this code to your clipboard.

{% hint style="info" %}
The Google Analytics tracking code (or measurement ID) will be displayed in the format: `UA-XXXXXXXXX-X`.
{% endhint %}

## Adding analytics to your site:

1. Now that you have your tracking code you can navigate to **Websites > Your Site** via NationBuilders sidebar.&#x20;
2. Navigate to **Site Settings > Analytics Setup**.
3. Paste your tracking code into the "Google analytics code" form field and save the settings. E.g.

<figure><img src="https://2029999482-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeL-FYaRUlvUn8HHUaD%2F-LjoIffnxwuuLzWshc3r%2F-LjoJ5dGygiP0b0Bccu6%2FScreen_Shot_2019-03-11_at_2_20_24_PM.png?alt=media&#x26;token=0c7332d9-dfc4-4fd1-b535-db209b59e77c" alt="Where to find the analytics setup tab"><figcaption><p>Where to find the analytics setup tab</p></figcaption></figure>
