Hello Magento Friends,

In this Magento 2 blog tutorial, we will learn How to Add Website Total Visitor on Admin Dashboard in Magento 2.

Knowing the total number of visitors to your Magento 2 store is an essential part of website analytics. It provides valuable data that can help you understand your audience, assess the effectiveness of your strategies, and make informed decisions to improve your store’s performance and user experience.

Let’s find out How to Add Total Visitors on the Admin Dashboard in Magento 2.

Steps to Add Website Total Visitor on Admin Dashboard in Magento 2:

Step 1: First, we need to create a di.xml file inside the extension at the following path.

app\code\Vendor\Extension\etc\adminhtml\

Then add the code as follows

Step 2: After that, we need to create a Sales.php file inside the extension at the following path.

app\code\Vendor\Extension\Block\Dashboard\

And add the following code-snippet

Step 3: Once all files are created in your Magento, you need to run Magento upgrade, compile and deploy commands as follows.

Output:

Total Visitors

Conclusion:

Hence, this way, you can add the total visitors count in the Magento 2 admin dashboard. If you have any doubts regarding the above steps, feel free to get in touch with me through the comment box. If you need further customization, contact experienced Magento Developers. Share the tutorial with your friends and stay in touch with us for more such useful solutions.

Happy Coding!

Click to rate this post!
[Total: 1 Average: 5]