Table of contents
Want deep analytics for your Ghost publication? Ghost integrates with Google Analytics using clean code injection. Get in-depth site metrics and gain a deeper understanding of your readers with a seamless integration for site-wide tracking. Google Analytics is the most widely used platforms for analysing site data in Ghost, and it only takes a few minutes to setup!
Set up a new Google Analytics property
When you set up a new Google Analytics account, follow the instructions to create your first property for your Ghost site.
If you're already using Analytics, navigate to the admin area from the cog button in the bottom left corner, and use the middle column button to create a property:
On the next page, you'll need to provide some information about your site to create a property and generate a tracking code which you'll need for the next step.
On this page:
- Select 'website' to track your Ghost site
- Enter a name, which can be anything, for your own reference inside of Analytics
- Enter your Ghost publication URL ensuring to select
https://if you are using SSL
- Pick an industry category (the most relevant one you can find in this list)
- Select a timezone to report in, which is usually the timezone you are in.
Get the tracking code
Once you've created a new property you will be redirected to the tracking code page:
Use Ghost Code Injection
In Ghost you can inject code across your entire site or on an individual post or page. Since Google Analytics needs to track user behaviour across your entire site, we'll use the global code injection feature which can be found in the Ghost Admin settings menu.
Google Analytics requires the tracking code to be in the
<head> of each page on your site, so paste it into the Header section and hit save.
Your site is now fully integrated with Google Analytics and you can review your site metrics on the Google Analytics dashboard at any time!