-->

How to add page view, post views counter in blog or website 2016

Iklan Anda

Ever wonder how many people visit your website? If you're an administrator of a website then sure you are. Post view counter or tracker is a widget or plugin that counts (and also displays) how many times a posts has been viewed. This helps blog author (and also readers) to know how much popular that post is. But to create this type of plugin, you have to know php, database, javascript etc, which is not so easy. However I've found a website, Firebase that also does the same job. You can create free accounts at Firebase and you can use their scripts to install post view counter in your blog. It doesn't matter which blogging platform you're using because Firebase works with all major blogging platforms and websites.



Follow steps:



Step #1: Create Your Firebase Account

Signup for your free account. Follow the steps carefully given at Firebase to activate your account.




Step #2: Create Your Database at Firebase:



Firebase offers you to create 10 unique databases. In our case, only one database is required. Create one to store your post view stats. Give your database a unique name


Step #3: Install Post View Counter Plugin
  1. Sign in to Blogger account and go to Blogger dashboard.
  2. Click the arrow adjacent to 'Go to post list' icon and select 'Template' from the drop down menu. Alternately you can click 'Template' from left navigation menu if you're already within your blog.
  3. Click 'Edit HTML'.
Skip this step if jQuery library already installed in your blog. Otherwise search for (Ctrl+F) <head> and paste (Ctrl+V) the following line just after <head>.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
     
  •  Search for (Ctrl+F) </head> and paste (Ctrl+V) the following code before </head>.
Replace --YOUR DATABASE-- text with your actual database you've created in step #2 but don't remove quotation around your database.

  • Search for (Ctrl+F) </b:skin>, copy (Ctrl+C) the following code and paste it (Ctrl+V) before </b:skin>.


  • Search for (Ctrl+F) post-header. You'll find the a code similar to the following one.
<div class='post-header-line-1'/> </div>
  • Replace <div class='post-header-line-1'/> with the following code.

<div class='post-header-line-1'>
  <div class='blr-view-counter'>Post Views: <span class='blr-view-loading'/></div>
</div>



Enjoy !
I tried my best to keep things simple as possible. Any type of question related to this will be appreciated.
Happy Blogging.

Iklan Anda

Tags:
Buka Komentar
Template By Muh Akram