Join Our Telegram Channel Join Now!

How to Add Real View Counter in Plus UI Blogger Template

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

 Hello! Welcome to Tecky AaryaN. 

You are looking for How to Add Real View Counter in Plus UI Blogger Template then this post is just for you.

© Copyright 2024 Techy AaryaN 

Adding an automatic view counter to your Blogger theme is a simple process that can be done in just a few steps. Here's a breakdown of how to do it: 


1. Create a Database on Google Firebase

To begin, create a new project on Google Firebase by visiting the Firebase Console page and clicking "Create a Project". Then enter the desired project name and click "Continue" to proceed. [Check Image]


After creating a project name, leave the default settings as is and click "Continue." To configure Google Analytics settings, click "Select an account" and choose the Google Analytics account in use, then click "Continue.

Now click create project and it will take few seconds.

Your project is ready to use. Now click on Realtime Database

Click on Create Database. And selete any Database Location. I am Selecting United State (us-central01). After that slect the lock mode and click Enable.

Now click on rules. [See Image]

After that remove all rule code and paste below rules code in rule section. [See Image]

Now copy the Database Url

JSON CODE Rules 

For Single Site

{

  "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 Site
{

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

      }

    }

  }

}

Don't forget to change BlogID. Replace BlogID with Your BlogID

2. Setup Blogger Template

Now open your Blogger theme & open Edit HTML and find realViews The code look like below.

realViews: {

  databaseUrl: "",

  abbreviation: "false"

}
Now add the database url inside the quotation
realViews: {

  databaseUrl: "https://example-rtdb.firebaseio.com",

  abbreviation: "false"}
That's it! Save the template and check if the views counter is working by visiting the URL or article on your website.

 
To appreciate our works, consider keeping the credits in codes. We don't allow to rewrite this post in any manner. Don't copy this post, codes or any part from this article without Permission, it is strictly prohibited. If you do so, Legal Actions will be taken.

Copyright

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.