Nuno Maduro simply launched a brand new PHP package deal referred to as Pan. Pan is a light-weight and privacy-focused PHP product analytics library. It’s designed as a quite simple package deal you can set up through composer require
and begin monitoring your pages or elements with a easy data-pan
attribute.
At present, Pan tracks solely the next occasions: impressions, hovers, and clicks. It doesn’t accumulate any private info, resembling IP addresses, person brokers, or any information that could possibly be used to determine a person.
Pan Use Instances
- you’ve completely different tabs inside a web page with the identical URL, and also you need to know which one is essentially the most considered. By including the
data-pan
attribute to your tabs, you’ll be able to observe this info. - you’ve completely different register buttons in your software, and also you need to know which one is essentially the most clicked. By including the
data-pan
attribute to your buttons, you’ll be able to observe this info. - you’ve completely different “assist” pop-hovers in your software, and also you need to know which one is essentially the most hovered. By including the
data-pan
attribute to your pop-hovers, you’ll be able to observe this info. - and so forth…
How does Pan work?
Through middleware, Pan injects a easy JavaScript library into your HTML pages. This library listens to occasions like considered
, clicked
, or hovered
and sends the info to your Laravel software. Be aware that this library doesn’t accumulate any private info; resembling IP addresses, person brokers, or any info that could possibly be used to determine a person.
Additionally on the client-side, these occasions are collected in a really performant manner and batched collectively to scale back the variety of requests to your server.
On the server-side, Pan solely shops: the analytic title, and a counter of what number of occasions the completely different occasions had been triggered. Through the pan
Artisan command, you could visualize this information, and hopefully use this info to enhance your software.
Go to the tasks Github for full particulars.