How to add Google Analytics to Ghost Blog

Google Analytics is one of the most popular and powerful tool, following article explains how to use add Google Analytics to Ghost Blog. There are two methods to do so.

Adding Google Analytics using Code injection

Follow these steps and you are all set.
1. Add your website to https://analytics.google.com and get the unique code.
2. Login to Ghost Admin section and go to Settings –> Code Injection

3.Insert your code in this section and click “Save” and you are done.

Adding Google Analytics to Ghost theme

  1. Add your website to https://analytics.google.com and get the unique code.
  2. Go to ..contentthemes
  3. Find default.hbs file and open it in your favorite a text editor. I use brackets.
  4. Add it just below the {{ghost_head}} and above .

    5.Restart the ghost and you are all set.

How to install Ghost blog for free on Heroku

Ghost is a fully open source, hackable platform for building and running a modern online publication. It is a very good alternative to WordPress and blogger and Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud. Heroku offers a free plan for experiencing the cloud. You can install Ghost on Heroku for free. Following is the step by step guide for installing Ghost Blog on Heroku.

  1. Download Ghost blog from here: https://ghost.org/developers/
  2. Unzip it into required folder.
    Unzipped folder name is “ghost-0.11.3”. You can keep the name same or change it to any other name. I have renamed folder to “mytravels” as this is my blog name.
  3. Initial NPM and Install required NPM modules
F:mytravels>npm init  

Please follow the instructions as it appears on the screen.

F:mytravels>npm install  

This will take some time as it will install all dependencies.
4 . Initiate git repository

F:mytravels>git init  
Initialized empty Git repository in F:/mytravels/.git/  
  1. Login to Heroku by entering your Heroku credentials
F:mytravels>heroku login  
Email: youremail@gmail.com  
Password (typing will be hidden):Logged in as youremail@gmail.com  
  1. Create Heroku application
F:mytravels>heroku create  
Creating app... done, desolate-journey-89792 https://desolate-journey-89792.herokuapp.com/ | https://git.heroku.com/desolate-journey-89792.git  

cross check git configuration using following comments

F:mytravels>git remote -v  
heroku  https://git.heroku.com/desolate-journey-89792.git (fetch)  
heroku  https://git.heroku.com/desolate-journey-89792.git (push)  
  1. Add PostgreSQL database
F:mytravels>heroku addons:add heroku-postgresql:hobby-dev  
Creating heroku-postgresql:hobby-dev on desolate-journey-89792... free  
Database has been created and is available  
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pg:copy
Created postgresql-slippery-42334 as DATABASE_URL  
Use heroku addons:docs heroku-postgresql to view documentation  
  1. Get database configuration as below:
F:mytravels>heroku config  
=== desolate-journey-89792 Config Vars
DATABASE_URL: postgres://lnfyqtfomdenyr:HwyaPziUdy0bQ1_lE40OKgbZl6@ec2-54-247-95-102.eu-west-1.compute.amazonaws.com:5432/d3t3m6qujeadp4  

These details appear in following order:

postgres://{POSTGRES_USER}:{POSTGRES_PASS}@{POSTGRES_HOST}:{POSTGRES_PORT}/{POSTGRES_DB}  
  1. Rename config.example.js to config.js and add following code
        production: {
        url: 'http://www.example.com',
        mail: {},
        database: {
            client: 'postgres',
            connection: {
                host: 'POSTGRES_HOST',
                user: 'POSTGRES_USER',
                password: 'POSTGRES_PASS',
                database: 'POSTGRES_DB',
                port: '5432'
            },
            debug: false
        },
        server: {
            host: '0.0.0.0',
            port: process.env.PORT
        }
    },
  1. Add your domain name using following command
{gfm-js-extract-pre-1}  
  1. Deploy these local changes to Heroku.
git add .  
git commit -am "first commit"  
git push heroku master  

Keyword Research

Whether one is trying to find out niche website, new trends in domain or looking for a new subject for blogs next article, keyword research is the starting point. Developing a list of keywords is one of the first and most important steps in any search engine optimization initiative. Keyword research is a critical component for search engine optimization because when used correctly it provides a road map for both the design and execution of building websites and developing content.

Your keywords in web content makes it possible for people to find website via search engines. A website that is well optimized for search engines “speaks the same language” as its potential visitor base and search engine. In other words, one need to know how people are looking for the products, services or information that website offer, in order to make it easy for them to find you—otherwise, they’ll land on one of the many other pages in the Google results. Implementing keyword SEO will help website rank above competitors.

Following article will discussion scientific method and step by step activities to be done for keyword research. It will also list useful and free tools and websites for keyword research.

What is keyword Research?

“Keyword research is a practice used by search engine optimization professionals to find and research actual search terms people enter into the search engines when conducting a search.”
A keyword is generally a word or phrase that is a topic of significance. Searchers use keywords as a way to identify and verbalize their problem or topic in which they’re looking for more information
Benjamin Brandall from https://ahrefs.com/ calls it a game, the front page of Google is the leaderboard, with each ranked page being one of the top 10 scores.

Competitor Analysis
  1. Using competing website using https://adwords.google.com
  2. https://www.semrush.com/
  3. https://www.spyfu.com
Find Keywords
  1. keyword search box using http://adwords.google.com/keywordplanner
  2. https://moz.com/products/pro/keyword-explorer
  3. https://www.semrush.com/
  4. http://keywordshitter.com/
  5. https://ubersuggest.io/
  6. http://www.wordstream.com//keywords/
  7. https://app.wordtracker.com/
  8. http://www.keywordspy.com/
  9. Using quora.com to find related keywords
  10. Using social media websites (Facebook and writer) to find what people are searching
Keyword Trend
  1. Using google trends to identify search volume over period of time https://www.google.com/trends/

Keyword research should be an ongoing and ever-evolving part maintaining a website. Old keywords need to be reevaluated periodically, and high-volume, competitive keywords (or “head” keywords, as opposed to long-tailed keywords) can often be usefully replaced or augmented with longer, more specific phrases designed not to bring in just any visitor but exactly the right visitors.

Reference articles

https://ahrefs.com/blog/keyword-research/
http://www.wordstream.com/seo-keyword
http://www.wordstream.com/keywords
https://moz.com/beginners-guide-to-seo/keyword-research
https://moz.com/blog/category/keyword-research
http://www.seonick.net/keyword-research/

Git Quick Reference

Git is the most useful tool for developers but if someone does not use it for a while, it all seems confusing. Git is tricky. Here are some of the most commonly used command.

  • Copy remote repository to your local folder.
git clone ssh://abc...xyz.git/  
  • Create new git repositiory
git init
  • To get list of files changed in directory
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: MySQL/MySQL_Select.py

Untracked files:
(use "git add <file>..." to include in what will be committed)

MS Excels/xlsx_read_into_pandas.py
MySQL/MySQL_update.py
image/

no changes added to commit (use "git add" and/or "git commit -a")
  • View remote repository name
$ git remote -v
origin https://github.com/conquistadorjd/python-01-utilities.git (fetch)
origin https://github.com/conquistadorjd/python-01-utilities.git (push)
  • Once you have made your changes and ready for deployment, you following set of commands for deployment.
git add .  
git commit -m "commit comment"  
git push origin master  

For heroku application use following

git push heroku master  
  • What is the difference between git push origin and git push origin master

Following command only pushes your master branch to origin

git push origin master

Following command pushes all your branches to origin

git push origin
  • Get commit history
$git log