In today’s Internet SEO is one of the most important part of every organization. It can be a deciding factor on what customers are choosing. Today nobody goes to 2nd page in google search results. And there are billions of results for every search query.
So to be not lost in the wild, Search Engine Optimization is used which particulary gives your website a boost. It generally has some bunch of features and norms that must be satisfied and implemented to adhere to standards.
Second important feature is knowing your visitors, your visitor’s age group, preferences, habits and much more. For that also there are a bunch of tools available. **Google Analytics is one of them.
Integrating Google Analytics to Jekyll sites hosted on Github pages
- Sign up for google analytics.
- Get your tracking code from your dashboard
- Since I am using Minimal-Mistakes theme, i have to put the script inside `_include/analytics-providers/google-universal.html
- Otherwise create a new file
_include/analytics.htmland put your tracking code there. Jekyll will automatically copy your tracking code to every web page.
- After this add changes to
analytics: provider: "google-universal" google: tracking_id: "UA-1234567-8"
Google Analytics is done. :D
Next step is to verify your site property ownership-
- The recommended method does work, just download file put it in your github repository and you are good to go. (Don’t put www as your top level domain in google property)
- Also the meta tag verification in alternate methods in google webmaster tools works.
- Add a custom variable in
config.ymland then add it to
_layouts/default.htmlas a meta tag. This will verify your ownership to the site. Reference - Link
- Add your sitemap.xml to google webmaster dashboard for crawler to efficently crawl your website.
- BTW it will by default use your sitemap.xml for crawling and also robots.txt
- Take the Google Mobile Friendly test and upload the results.