Adding Google Analytics to Ghost

Once your new blog with Ghost is up and running, you may want to track the traffic that it generates and gather data about your audience.

Google Analytics offers possibly the best tool in this sense within the free plan.

Create a new Google Analytics account if you haven't yet, and get the tracking code it provides. At the present time, the tracking code can be found under Admin > Account > Property > Tracking Info > Tracking Code.

You should find the tracking code for your site under a line of text in bold that says "This is your tracking code. Copy and paste it into the code of every page you want to track."

Your Tracking ID should be something like UA-1234567-1 (of course your specific numbers will wary).

Copy the entire script (including the tags <script> and </script> at the top and bottom of it).

Now, back to the Admin of your Ghost blog ( to quickly access it) and on the panel at the left click on Code Injection.

On the Code Injection section you should see two text field, one for the Header, and the other for the Footer. We'll put the Google Analytics code in the header, so paste it into the text area on top, including the script tags.

It should look something like this.

Once you have pasted the code and click on the big blue Save button on the top right of the screen, Google Analytics should start tracking the traffic generated by your site.

You can verify that everything is working as expected on the same page where you found the tracking code. The verification process may occasionally take a few hours, but generally it is quite fast.