Welcome back to another tutorial, have you informed about the realtime post view counter functionality that is recently added to the plus ui theme of the blogger website. No? Then I will want to tell you that plus ui added this feature that will help a lot to get post views.
Without wasting more time let's roll into the tutorial:)
Steps for adding post counter viewers in blogger ;
Step 1: Create a new firebase account.
Step 2 :First create your database for your project.
Step 3 :Paste the following codes.
For single blog
{
"rules": {
".read": true,
"BlogID_0000000000000000000": {
".read": true,
"$post_id": {
".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
}
}
}
}
For multiple blogs
{
"rules": {
".read": true,
"BlogID_0000000000000000000": {
".read": true,
"$post_id": {
".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
}
},
"BlogID_0000000000000000000": {
".read": true,
"$post_id": {
".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
}
},
"BlogID_0000000000000000000": {
".read": true,
"$post_id": {
".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
}
}
}
}
And copying the url of database go to theme section of your blogger website.
Then find for the below codes.
realViews: {
databaseUrl: "",
abbreviation: "false"
}
And then paste the database url into it.
Moreover if you want to display data in 3.2K instead of 3200 then change the abbreviation to true
realViews: {
databaseUrl: "",
abbreviation: "true"
}
Contact us:
If you still face problem in showing views to the users then don't hesitate to contact us We are available anytime.