Aller au contenu

Using Google Analytics with Ghost

Ce contenu n’est pas encore disponible dans votre langue.

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.

  1. Sign up for a Google Analytics account at Google Analytics.
  2. Obtain the Tracking ID for your site.

Some Ghost themes support Google Analytics by default. If your theme does not, follow these steps:

  1. Log in to Google Analytics, click Admin → Tracking Info → Tracking Code, and copy the entire tracking code, including <script> and </script> tags.
  2. Using SSH, navigate to installation_directory/content/themes/theme_name, where installation_directory is your Ghost installation folder and theme_name is your active theme.
  3. Open the default.hbs file with a text editor.
  4. Paste the Google Analytics code just before the closing </head> tag.
  1. Save the default.hbs file.
  2. Restart Ghost. Google Analytics is now enabled.

For further details, visit Google Analytics.

Cette page vous a-t-elle aidé ?