How to Show Post Views in Blogger

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.


Help us improve this article by leaving your feedback below.
  1. Sayem Tutorial
    Sayem Tutorial 7 Apr 2020, 09:25:00

    Bro Thanks For This: Image

    Reply Delete
  2. Sayem Miaji
    Sayem Miaji 30 Apr 2020, 06:52:00

    bro how can i add .k .h .lakh feature on post viewer like youtube

    Reply Delete
  3. Unknown
    Unknown 7 May 2020, 20:56:00


    Reply Delete
  4. 11 Jun 2020, 00:38:00

    Plase help me its no working

    Reply Delete
  5. Call of Duty: Mobile Reward
    Call of Duty: Mobile Reward 26 Dec 2020, 01:57:00

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

    Reply Delete
  6. Coding0toAdvance
    Coding0toAdvance 22 Jan 2021, 22:41:00


    Reply Delete
  7. Vishal Singh
    Vishal Singh 21 Mar 2021, 23:48:00

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

    Reply Delete
  8. JhannoSJY Muñoz
    JhannoSJY Muñoz 20 May 2021, 17:32:00

    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

    Reply Delete
  9. Admin
    Admin 21 Nov 2021, 13:22:00

    Thank U So Much It work for me <3

    Reply Delete
  10. Admin
    Admin 21 Nov 2021, 13:28:00

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

    Reply Delete
Add Comment
Previous Post Next Post