Google Analytics for Ghost

Google Analytics for Ghost

by John Vincent

Posted on March 1, 2017

This is part of a series of discussions regarding Deploying to a Digital Ocean Droplet. For more details, please see Overview of website

Google Analytics for Ghost
  • Add Account
  • Login
  • Admin
  • Account (list with a drop-down)

From drop-down

* Create new account.
Account name: ghost
Website name: Ghost Blog
Website url:
  • Get Tracking Id

    • Shows Website Tracking Code:
    • Copy the code

Add to Ghost Theme

For your active theme:

cd /var/www/ghost/content/themes/{your-theme}
  • Edit default.hbs

    • Paste the code before the closing body tag and before the script includes.
    • Save.
Restart Nginx
sudo systemctl restart nginx

Restart Ghost.
pm2 restart all

Delete Google Analytics Account



  • Account (list with a drop-down)
  • Select Account to be deleted.
  • Account Settings
  • Middle, far right, see:

    • Move to Trash Can

Review Google Analytics Data

  • Login
  • List Accounts
  • Select All Web Site Data