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.
The idea was that the first event will set the
new_visit
flag (if requested duringinitialize
). To achive this, I added acopyWith
method to theMatomoEvent
class in the style of flutterscopyWith
methods (e.g.TextStyle.copyWith
,InputDecoration.copyWith
,...).I also decided to not set the
new_visit
parameter to0
if it's not requested, but to just not set the parameter at all. I felt like setting it to0
could imply that we are expressly requsting to continue the old visit, what afaik is not supported by Matomo.