# Using Google Analytics with Ghost

> Track visitor traffic on your Ghost site by creating a Google Analytics account and adding the tracking code to your theme.

Source: https://helpcenter.ruachost.com/apps/other-apps/using-google-analytics-with-ghost/

Google Analytics provides detailed statistics about visitor traffic to your site. To use it with Ghost, you need a Google Analytics account and a unique Tracking ID.

## Setting Up Google Analytics

1. Sign up for a Google Analytics account at [Google Analytics](http://www.google.com/analytics).
2. Obtain the **Tracking ID** for your site.

## Editing the Theme

Some Ghost themes support Google Analytics by default. If your theme does not, follow these steps:

1. Log in to Google Analytics, click **Admin → Tracking Info → Tracking Code**, and copy the entire tracking code, including `<script>` and `</script>` tags.
2. Using SSH, navigate to `installation_directory/content/themes/theme_name`, where `installation_directory` is your Ghost installation folder and `theme_name` is your active theme.
3. Open the **default.hbs** file with a text editor.
4. Paste the Google Analytics code just before the closing `</head>` tag.

> **Caution:**
Include both the starting `<script>` tag and the ending `</script>` tag.

5. Save the **default.hbs** file.
6. Restart Ghost. Google Analytics is now enabled.

> **Note:**
It may take up to 24 hours for Google Analytics to change from *Tracking Not Installed* to *Receiving Data*.

## More Information

For further details, visit [Google Analytics](http://www.google.com/analytics).
