Floating-Dartists / matomo-tracker

A fully cross-platform wrap of the Matomo tracking client for Flutter, using the Matomo API.
https://pub.dev/packages/matomo_tracker
MIT License
26 stars 28 forks source link

New app launches should start new visits #77

Closed EPNW-Eric closed 1 year ago

EPNW-Eric commented 1 year ago

The idea was that the first event will set the new_visit flag (if requested during initialize). To achive this, I added a copyWith method to the MatomoEvent class in the style of flutters copyWith methods (e.g. TextStyle.copyWith, InputDecoration.copyWith,...).

I also decided to not set the new_visit parameter to 0 if it's not requested, but to just not set the parameter at all. I felt like setting it to 0 could imply that we are expressly requsting to continue the old visit, what afaik is not supported by Matomo.