ads

How to Add Post Views Counter to Blogger , Blogger Me Post view Kaise Show kare

T


oday we learn How to Add Post View Counter In Blogger website. By adding this function in blogger viewer also know your post views. Post view counter Help viewer which post is famous or not. you also know show page views in wordpress very easy install post view in wordpress by plugin and you easily see the post view on your website. But the same process is not possible in blogger because not any plugin system available in blogger. But in this post you easily learn How to Add Post View Counter In Blogger. you also know features and step to install this widget in blogger. If you want to see a demo of How to Add Post View Counter In Blogger given below..

How to Add Post View Counter In Blogger Features: 


1. very helpful to see post view. 2. Responsive widget. 3. Add any theme. 4. Real view count. 5. Easy to install in blogger simple copy and paste code given in install steps How to Add Post View Counter In Blogger Step to Install: 

1. Go To Blogger. 

2. Choose where you want to add post view counter.

 3. Go to Theme section and click edit theme button.

 <div expr:post-id='data:post.id'/> 

5. paste the below code where you want show page view or you also add in layout section by make new add widget

 <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>


6. if you want to show eye icon then paste the below code before </head> tag

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> 


7. for the function of post counting or proper function add below code before </body> tag.

 <script src='https://cdn.firebase.com/v0/firebase.js' type='text/javascript'></script>

<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://posts-views-1.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> 

8. At the last for the creation of firebase account or setting see the youtube video with full details given below.

Conclusion: If you are face any problem to install this post view counter in blogger then comment below for any type help. i pleasure to help you within 24 hours or you also use whatsapp chat button given at the end of website in right side. 
I hope my article is very helpful for you please subscribe my youtube  channel or like video or comment in youtube video or website post. 

Post a Comment

0 Comments