How to Show Post Views in Blogger

How to show post views in blogger

Do you know how anyone knows that the article which they are reading at that time is useful or not?
There are many factors that tells that the article is useful or not and one of them is how much views that article has got. In simple words how many people have read that article.

To show page or post views in WordPress is very easy you just simply have to install a single plugin and you will see the post views on your post pages.

But it is quite difficult for blogger but don't worry I am here to resolve all your issues and solve all your difficulties related to blogger.

Today in this article I am going to tell you how you can add post views functionality in blogger.

I always try to provide you the demo of the things which I share on this blog and if you want to see the demo you can see above in the beginning of this article just above the thumbnail of this article you will see how much views this article have got till now.

The demo looks something like this you can see below.

How to Show Post Views in Blogger

In WordPress you have to buy hosting and you can create databases in that hosting but for blogger you don't have to buy any hosting but for this page views counter functionality we will need to have database.

Don't worry you will not have to buy hosting we will use firebase which provides us free database management system and we can create as much databases as we want for free without paying a cent.

The procedure to implement this functionality in blogger is somehow difficult so that's why I have created a separate video which you can see and easily add post views counter functionality in blogger website.

I have explained everything in this video you can simply watch this video on My YouTube channel but for your ease I have placed that video right below.

Video About How to show Post Views In Blogger

See the video and if you face any difficulties you can comment below or comment on My YouTube channel I will be very glad to hear from you and provide you the solution of any difficulty that you are having.

So the code which you will need or which I have used in this video is provided below simply copy the code and make the changes that I have made.

Code to get blogger post id.
<div expr:post-id=''/>

You have to add the above code after the below code.
<b:includable id='post' var='post'>

Code To show Page Views.
<style>#views-container #page-views{margin-left:5px}</style>
<span id="views-container"><i class="fa fa-eye"></i><span id="page-views"></span></span>

You have to add the code provided below before </head>tag if you want to show eye icon.

<link rel="stylesheet" href=""/>

Database Connection & all functionalities Code paste it just above </body> tag.
<script src='' type='text/javascript'></script>
const convertSize=function(t){const o=["","KB","MB","GB","TB"];if(0==t)return"0";const n=parseInt(Math.floor(Math.log(t)/Math.log(1024)));return 0==n?t+" "+o[n]:(t/Math.pow(1024,n)).toFixed(1)+" "+o[n]};
$.each($('div[post-id]'), function(i, e) {
var blogStats = new Firebase("" + $(e).attr('post-id'));
blogStats.once('value', function(snapshot) {
var data = snapshot.val();
var isnew = false;
if(data == null) {
data= {};
data.value = 0;
data.url = window.location.href; = $(e).attr('post-id');
isnew = true;

If you will not see the video then you will not be able to add page or post views functionality in blogger so watch it first before doing any step by yourself.

I hope that you will like this article and please leave your feedback in the comment section below.

I am always waiting for your positive feedback so please don't make me keep waiting.


Was this article useful? Please Leave Your Feedback by writing what's in your mind, below.
  1. bro how can i add .k .h .lakh feature on post viewer like youtube

  2. Plase help me its no working

  3. Hello thnx for this but i cant find this : < expr:post-id=''/> :(

    1. Dear video is available on my channel see that video I think it will be easy for you to understand.

  4. bhai page view ki icon ko title ke niche date or authors likha hota hai waha par kaise display karenge please batawo

    1. Dear it's not the same for every blogger template. You can place the I can and the count number according to your requirement and to do so you must have knowledge about HTML and CSS.

  5. Hi, do you solve 'insecure rules' notifications from firebase?

    I always got emails from firebase periodically.

    [Firebase] Your Realtime Database 'sample-pageviews' has insecure rules.

    We've detected the following issue(s) with your security rules:
    > any user can read your entire database
    > any user can write to your entire database

    1. These notifications are shown because you need to allow read and write access to our firebase but if we block access these notification wont me shown but out views count setup will not work.

  6. Thank U So Much It work for me <3

  7. sir can u guide how to add dark or light mood in blogger like night mode or day mode with button???


Post a Comment

Was this article useful? Please Leave Your Feedback by writing what's in your mind, below.



Recent Comments

{getWidget} $results={3} $label={comments} $type={list}