Want deep analytics for your Ghost publication? Ghost integrates with Google Analytics using simple 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 prompts to create a new 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 click the blue
Create Property button.
Next, add a data stream and choose
Enter the URL for your website (like demo.ghost.io) and a stream name (like “My Ghost Site”). Choose the options you want to enable and click
Get the tracking code
Once your stream is active, you’ll see an option to add a global site tag.
Copy the provided code snippet to your clipboard.
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 behavior across your entire site, we’ll use the global code injection feature, which can be found in the Ghost Admin
Google Analytics requires the tracking code to be added to
<head> of each page on your site, so paste the copied code into the Header section and hit Save.
Confirm Google Analytics is working
Your site is now fully integrated with Google Analytics. In Google Analytics, go to Reports in sidebar, click on Realtime, and refresh your site. Your activity on the dashboard confirms that Google Analytics is working on our site!