By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Softweb TutsSoftweb TutsSoftweb Tuts
  • Chrome Extension
  • Artificial Intelligence
  • JavaScript
  • Information
Search
© 2024 Softweb Tuts. All Rights Reserved.
Reading: How to Show Post Views in Blogger Blog: A Step-by-Step Guide
Share
Notification Show More
Font ResizerAa
Softweb TutsSoftweb Tuts
Font ResizerAa
  • Chrome Extension
  • Artificial Intelligence
  • JavaScript
  • Information
Search
  • Chrome Extension
  • Artificial Intelligence
  • JavaScript
  • Information
Follow US
© 2024 Softweb Tuts. All Rights Reserved.
Show Post Views
Softweb Tuts > Blogger > How to Show Post Views in Blogger Blog: A Step-by-Step Guide
Blogger

How to Show Post Views in Blogger Blog: A Step-by-Step Guide

muzammil0011
Last updated: March 9, 2025 6:57 am
muzammil0011
Share
6 Min Read
Show Post Views
SHARE

Post Views in Blogger refer to the number of times a specific post on a website, such as a blog post or article, has been viewed by users.

Contents
Importance of Showing Post Views in BloggerHow Page Views are CountedVideo About How to Show Post Views In BloggerCode to get blogger post id.Conclusion

When a user visits a website and views a post, the website’s server will typically record this as a view. These views can then be accumulated and displayed on the website, either on the post itself or on a separate page, such as a statistics page.

Importance of Showing Post Views in Blogger

Post Views can be an important metric for website owners and bloggers as it can indicate the level of engagement and interest in their content.

High post views can indicate that a post is popular and resonates well with users; conversely, low post views may suggest that a post is not as engaging or relevant.

Some website platforms and content management systems, such as WordPress, have built-in functionality to track post views, but there are also external plugins and scripts that can be added to the website to track views.

Additionally, many website analytics tools, such as Google Analytics, can provide data on the number of post views.

How Page Views are Counted

It’s important to note that there are different ways to count views and some views might be counted multiple times, for example, if a user refreshes the page.

There are many factors that tell whether the article is useful or not, and one of them is how many views the article has. It shows 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.

It is quite difficult for blogger users to show post views on their website, but don’t worry, I am here to resolve all your issues and solve all your difficulties related to blogger.

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. For this page views counter functionality, we will need to have a database.

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

The procedure to implement this functionality in Blogger is somewhat difficult, so that’s why I have created a separate video in which you can see and easily add post views counter functionality in the Blogger website.

Video About How to Show Post Views In Blogger

So, the code that you will need or that 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='data: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="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>

Copy the code given below and paste it above the </body> tag.

<script src='https://cdn.firebase.com/v0/firebase.js' type='text/javascript'/>
<script>//<![CDATA[
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("https://your_firebase.firebaseio.com/pages/id/" + $(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;
            data.id = $(e).attr("post-id");
            isnew = true;
        }
        $("#page-views").text(convertSize(data.value));
        data.value++;
        if (window.location.pathname != "/") {
            if (isnew) blogStats.set(data);
            else blogStats.child("value").set(data.value);
        }
    });
});
//]]></script>

If you will not see the video, then you will not be able to add a 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.

Conclusion

By following these steps, you can effectively display post views on your Blogger site. Consequently, this enhancement can lead to increased user engagement and provide valuable insights into your content’s performance.

Remember to monitor your Firebase usage to ensure it meets your needs without exceeding free tier limits.

Share This Article
Facebook Twitter Copy Link Print
Share
By muzammil0011
Follow:
I am Muzammil, a Self-taught Web Designer & Developer. I haven't yet completed my college degree. Started learning programming at the age of 12 and still learning. I love to work in JavaScript and make eye-catchy designs. Free for your calls :)
Previous Article Blogger vs WordPress: Which is Best, Secure, and Cheap Blogger vs WordPress: Which is Best, Secure, and Cheap?
Next Article AIPRM Extension for ChatGPT AIPRM Extension for ChatGPT: Boost Your AI Conversations
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest News

Use Tailwind CSS with Vue and Vite
How to Use Tailwind CSS with Vue and Vite
Information Web Development March 8, 2025
Popular Hacking Attacks
Must Known – Most Popular Hacking Attacks in 2025
Information March 8, 2025
CSS vs SCSS
CSS vs SCSS: Which is Best and Easy for Development?
Comparison Information March 8, 2025
HTML vs PUG
HTML vs PUG: Which One Should You Choose?
Comparison Information March 8, 2025
Softweb TutsSoftweb Tuts
Follow US
© 2024 Softweb Tuts. All Rights Reserved.
adbanner
AdBlock Detected
Our site is an advertising supported site. Please whitelist to support our site.
Okay, I'll Whitelist
Welcome Back!

Sign in to your account

Lost your password?