Analytics is useful for getting site visitor information such as the number of visitors to a page, the average length of time visitors have accessed the site, etc. To use analytics on badaso, you must create Google Analytics account first. After that, get the View ID and Tracking ID from your analytics.
Insert the View ID and Tracking ID from your analytics to .env variable
To retrieve the site visitor information, you must create a service account for your analytics and download the service-account.json file. After that, you can store it in storage directory like below.
📦 Your Project ┣ 📂 storage ┃ ┣ 📂 app ┃ ┃ ┣ 📂 analytics ┃ ┃ ┃ ┗ 📜 service-account-crendetial.js /** Store the .json file here. **/
After that you can perform queries using classes provided by spatie/laravel-analytics. If you want to know more about the queries, visit spatie/laravel-analytics.