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
Section titled “Setting Up Google Analytics”- Sign up for a Google Analytics account at Google Analytics.
- Obtain the Tracking ID for your site.
Editing the Theme
Section titled “Editing the Theme”Some Ghost themes support Google Analytics by default. If your theme does not, follow these steps:
- Log in to Google Analytics, click Admin → Tracking Info → Tracking Code, and copy the entire tracking code, including
<script>and</script>tags. - Using SSH, navigate to
installation_directory/content/themes/theme_name, whereinstallation_directoryis your Ghost installation folder andtheme_nameis your active theme. - Open the default.hbs file with a text editor.
- Paste the Google Analytics code just before the closing
</head>tag.
- Save the default.hbs file.
- Restart Ghost. Google Analytics is now enabled.
More Information
Section titled “More Information”For further details, visit Google Analytics.