---
title: "Adding Google Analytics to Ghost"
description: "In this article, we will walk you through the process of manually adding Google Analytics to your website built with Ghost. Unfortunately, at the time of writing this Ghost does not have a plugin or..."
url: https://www.inmotionhosting.com/support/website/analytics/adding-google-analytics-to-ghost/
date: 2013-10-16
modified: 2023-06-12
author: "Jeff Matson"
categories: ["Web Analytics"]
type: post
lang: en
---

# Adding Google Analytics to Ghost

In this article, we will walk you through the process of manually adding [Google Analytics](/support/website/google-tools/installing-google-analytics-on-your-website/) to your website built with Ghost. Unfortunately, at the time of writing this Ghost does not have a plugin or specific setting to integrate Google Analytics to your site, but the process is still fairly straightforward due to the simplicty of Ghost themes.

## Adding a new site to Google Analytics for Ghost to use

[![](https://www.inmotionhosting.com/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-1-1024x541.png)](/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-1.png)

If this is the first time that you are setting this site up with Google Analytics, you will need to first create a new site within Google Analytics. To do so, log into your Google Analytics account, then click on Admin. The left side section will have a dropdown box. Click on that, then click on “Create new account”.

[![Account setup options](https://www.inmotionhosting.com/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-2.png)](/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-2.png)

Next, simply enter in your information for your site such as a name for it, the URL, category, and time zone.

[![Website UA tracking code example](https://www.inmotionhosting.com/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-3.png)](/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-3.png)

After you have created the new account, you will be provided a tracking code. Be sure to keep this in a easy to remember place as you will be using it for the next steps.

## Inserting your Google Analytics tracking code into Ghost

Although we do not yet have a solution available to place Google Analytics within a site made with Ghost directly through the admin dashboard, it can be inserted just as easily within your Ghost theme.

[![Ghost theme file list](https://www.inmotionhosting.com/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-4.png)](/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-4.png)

First, you will need to locate a file that is used on every page within your Ghost theme. In this example, we are using the default Casper theme in which we can easily insert it into the default.hbs file. Any themes will be located in their respctive folders inside the /content/themes folder.

[![Ghost theme header section](https://www.inmotionhosting.com/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-5.png)](/support/wp-content/uploads/2013/10/ghost_ghost-google-analytics-5.png)

From here, locate your default.hbs file and open it. In here, you will see some familiar HTML tags. Then, locate the </head> tag. Once you have found this HTML tag, simply place your Google Analytics code directly above it. Once it is in there, save your file and restart Ghost. You should now see your data being successfully tracked by Google Analytics.
