Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Royal's avatar

Creating tracking system

Hi Laravelers,

I want to create a tracking system for couple of applications of mine, a very small version of Google Analytics.

And I am wondering if i should create a package that will be responsible for sending cURL request to the API i am using to store statics or just put scripts in the footer just like Google Analytics works.

What's the best way to do it? And What steps i must follow or any other tips you can give me.

Thanks

0 likes
1 reply
RoboRobok's avatar

I would go with <script>. Gathering stats is purely attachable functionality and it's perfect if you can detach it easily. Plus, if you need some client data, like screen resolution, there is no way to do it with on the PHP backend. You will need some client code after all.

Please or to participate in this conversation.