How To Display Post Views Counter in Blogger Post in 2021

post views script for blogspot

Many blogspot users have been looking for ways to display post views count in blog. They really thought getting blogger post views counter script is a big deal but no, anybody can add post views counter to their blogger template. All you need to do is just follow the steps below without making any mistake. You have got no issues with this as you can see the demo from our blog. 

How To Add Post Views Counter to Blogger

  • Login to your blogger dashboard and navigate to the Theme.
  • Click on the (drop down menu) arrow beside the "CUSTOMIZE" button.
  • Click on Edit HTML.
  • On the HTML console, search for </body> alternatively, you can scroll to the end of the codes, then you will see the </body> right above </html>.
  • Paste the following script right above the </body>

<script src='https://cdn.firebase.com/v0/firebase.js' type='text/javascript'></script>
<script>
//<![CDATA[
$.each($(".post-view[data-id]"),function(h,e){var a=$(e).parent().find("#postviews").addClass("view-load"),g=new Firebase("https://view-post-da9db.firebaseio.com/pages/id/"+$(e).attr("data-id"));g.once("value",function(d){var b=d.val(),c=!1;null==b&&(b={},b.value=0,b.url=window.location.href,b.id=$(e).attr("data-id"),c=!0),a.removeClass("view-load").text(b.value),b.value++,"/"!=window.location.pathname&&(c?g.set(b):g.child("value").set(b.value))})});
//]]>
</script>
  • After pasting the script, apply the below code, anywhere you want the Blogspot post view counter to appear around your post.
<span class='post-view' expr:data-id='data:post.id'></span><i class='far fa-eye'/> <span class='view-load' id='postviews'/> views

You can then check any of your posts to see the post views counter working.

If you got any issues or questions, feel free to use the comment box. 
John
John
Website Designer, Blogger and an Engineer. Cybersecurity student and the founder of this Blog. facebookwhatsapptelegram

You may like these posts

4 COMMENTS

  1. SEO is very important for your online business. For example, if you are running a business on your website, you can earn a lot of money by doing SEO because through this, your website will appear on Google's first page, and you will get more visitors. Buy Dissertation Online.

    ReplyDelete
  2. Nice Post, I also have website but it have many issues, like m=1 and zero view on it. Can you guid me how to edit it. My site TheGlobx

    ReplyDelete
    Replies
    1. Sorry ma'am, I can't understand your question?

      Delete