How to Integrate Google Analytics with Ghost
How To Ghost

How to Integrate Google Analytics with Ghost

Mishel Shaji
Mishel Shaji

Google analytics allows you to analyze in-depth detail about the visitors and activities on your website. There are two ways to integrate Google analytics with Ghost.

  1. Using built-in code injection.
  2. Adding tracking code to theme files.

Integrate Google Analytics using code injection

This is the easiest way to integrate Google analytics with Ghost. Follow these simple steps to integrate GA with your Ghost blog.

  1. Login to the Google analytics account.
  2. Go to admin section.
  3. Click Create Property button.
  4. Select Web in the next window.
  5. Provide property details in the next page and click Create.
  6. Select the property -> navigate to tracking info section -> click on Tracking code and copy the tracking code.
  7. Sign in to your Ghost admin dashboard from https://yoursite.com/ghost.
  8. Go to Settings -> Code Injection.
  9. Paste the tracking code in the header section of code injection.
Code injection in ghost

Adding analytics code to theme files

  1. Login to the Google analytics account and obtain the tracking code.
  2. Login to Ghost admin dashboard.
  3. Go to Settings -> Design and download the active theme.
  4. Extract the file and open default.hbs in a text editor.
  5. Add tracking code between the <head> </head> tags and zip the theme.
  6. Click on Upload a theme button in the same page (Design) of your admin dashboard and upload the zip.
  7. Click activate.
Ghost admin dashboard

This is how we can integrate Analytics tracking code in Ghost.