v4.1.0
What's changed
- Added custom properties: attach your own
name => valueattributes to users and visitors (e.g.subscription,company, an A/B test variant) and group your analytics by them in the dashboard. - Added
custom_properties_resolversconfig option with auserand avisitorslot. Register a class implementingResolvesUserCustomPropertiesorResolvesVisitorCustomPropertiesto have properties resolved and sent automatically whenever a user or visitor is tracked. - Added
SimplestatsClient::trackCustomProperties()to set properties manually on demand for a user or visitor. - Visitor properties are inherited by the registration of the same visit, so registrations, conversion rate and revenue can be grouped by properties assigned before sign-up (e.g. an A/B test variant).
- The
stats-visitorandstats-usertrack payloads now carry an optionalpropertiesobject. - Added tracking events fired alongside each track:
VisitorTracked,UserTracked,LoginTracked,PaymentTracked,CustomEventTracked,CustomPropertiesTracked. trackCustomEvent()now skips events for visitors that were never tracked (bot, blocked IP, excluded route), since they could never be attributed.
Upgrade
Upgrading from v4.0 is a no-op. Custom properties are opt-in: nothing changes until you configure a resolver or call trackCustomProperties().
To get started, set in config/simplestats-client.php:
'custom_properties_resolvers' => [
'user' => App\Analytics\UserCustomPropertiesResolver::class,
'visitor' => App\Analytics\VisitorCustomPropertiesResolver::class,
],See the custom properties docs for the full walkthrough.
Full Changelog: v4.0.2...v4.1.0