Adding Disqus and Google Analytics to Ghost blog

When I started blogging with Ghost, the first changes I made were adding Google Analytics to the blog and Disqus to each post.

git clone

Adding Google Analytics

Edit Casper-1.0.0/default.hbs and add the following code (remember to update the Google Analytics identifier) just above < /head>.

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', 'UA-00000000-1', 'auto');
  ga('send', 'pageview');

Adding Disqus to posts

Edit Casper-1.0.0/post.hbs and add the next code just below the {{/post}} tag.

    <div id="disqus_thread"></div>
    <script type="text/javascript">
      (function() {
       var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
       dsq.src = '';
       (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);

Now you can zip the complete theme, and upload it using 'Upload a new theme' button in the ghost site management. When you click the 'Save all blog settings' button, the new theme will be applied.

zip -r Casper-1.0.0/*