Boost blog engagement! Learn how to Add/Display Post Views Counter in Blogger easily. Track popularity and impress your readers. 📈 #BloggerTips
How to add Post Views Counter in Blogger Posts
Please follow these steps carefully to get the correct final results but first create a backup file for your theme.
Create your Firebase Account
Create/Add New Project
- After logging in, you'll find yourself on the Firebase Console dashboard.
- Look for the "Add project" button. Click on it to start the project creation process.
- A window will pop up, prompting you to enter a project name. Choose a name that represents your blog or post views counter, making it easy for you to identify the project later on.
- Once you've entered the project name, you can proceed to set up the project by selecting the desired settings and configurations. For most post views counter implementations, the default settings should suffice.
- Click the "Continue" button, and Firebase will proceed to create the project for you.
- After the project is created, you will be automatically directed to the project's dashboard.
Create Realtime Database
[{"rules": {".read": true,".write": true,}}]
Intalling Postveiws Plugin in Blogger
- Go To Blogger > Template.
- Backup your template
- Click Edit HTML
- Put the following code just before the </head> tag.
[<!-- Jquery Library and Font Awesome CDN --><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'/><link crossorigin='anonymous' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css' integrity='sha256-46qynGAkLSFpVbEBog43gvNhfrOj+BmwXdxFgVK/Kvc=' rel='stylesheet'/>]
[<!-- Start Post Views Script by tipricks.com --><script src='//cdn.firebase.com/js/client/2.2.1/firebase.js' type='text/javascript'/><script>//<![CDATA[(jQuery);$.each($(".post-view[data-id]"),function(c,f){var b=$(f).parent().find("#postviews").addClass("view-load"),d=new Firebase("https://tipricks-postviews-default-rtdb.firebaseio.com/pages/id/"+$(f).attr("data-id"));d.once("value",function(e){var a=e.val(),g=!1;null==a&&(a={},a.value=0,a.url=window.location.href,a.id=$(f).attr("data-id"),g=!0),b.removeClass("view-load").text(a.value),a.value++,"/"!=window.location.pathname&&(g?d.set(a):d.child("value").set(a.value))})});//]]></script><!-- End Post Views Script by tipricks.com -->]
- [message]
- ##warning## Important
- Change the highlighted URL (https://tipricks-postviews-default-rtdb.firebaseio.com) with your database URL.
[<span class='post-view' expr:data-id='data:post.id'><span class='view-load' id='postviews'><i class='fas fa-spinner fa-pulse faa-fast'/></span> Views</span>]
- [message]
- ##warning## Important
- You can replace the Views with any text you like.
Copyrights
Copyrights: Developers and niche bloggers are most welcome to share this Plugin with their readers and friends. Please attribute the credits back to TipRicks™ as the only favor in return. It takes hours of effort to write and debug these scripts. This plugin comes under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Need Help?
This article "How to Add/Display the Post Views Counter in Blogger" is protected by
COMMENTS