DEV Community

HARSH VATS
HARSH VATS

Posted on

How to see who is visiting your site?

Have your created your stunning website? But now don't know how to check how many visitors are coming and from which platform they are accessing your site. So in this tutorial I'll tell you how you can analayze traffic of your site.
For this we will use Firebase.

What is Firebase?

Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014. As of March 2020, the Firebase platform has 19 products, which are used by more than 1.5 million apps. And we will use Firebase analytics for our purpose.
So Let's start :)

  1. Go to https://console.firebase.google.com and sign-in with your account.
  2. Now create new project. Copy the keys and the script tags of your project.
  3. Paste the script tags in your html head section so you can access the firebase services.
  4. Paste the keys just below the script tags in the head section.
  5. Now you just need to initialize your app with firebase using firebase.initializeApp() function and call firebase.analytics() function inside the same script tag.
  6. Now it's all done. Just go to the https://analytics.google.com and sign-in with the same account you used for firebase sign-in.

So now you can see live users to your site, total users with custom date ranges, how many users use what platform, whether users are coming from external links or organic traffic, your income(if adsense is enabled), engagement time of users, how many pages they visit, etc.

I hope it's all clear from above but still if you have any doubts then feel free to ask in comments.

Latest comments (0)