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

More campaigns, path, pvId #109

Closed EPNW-Eric closed 1 year ago

EPNW-Eric commented 1 year ago

I did some more research and testing regarding campaigns and added those findings to the documentation.

However, one key learning is that not only page views can have campaigns, but other actions like events or content tracking, too. In retrospective, this seems only logical, since the campaign settings are encoded in the url parameter and it turned out that the url parameter is actually used in every track... call in the JavaScript Tracker, what kind of supprised me:

But to conclude I now think that every track... call should have the possibility to set a campaign and a path (what relates to having an url in our case). Imo the path is related to the page view (just as pvId) but a developer should have the opportunity to manually set it, so my approach was to add the path parameter to every track... call (with appropriate documentation) and change attachLastPvId to attachLastScreenInfo so it not only accounts for the automatical attachment of pvId but also of path. Futhermore I found out, that most track... calls can have a pvId (until now I thought only event and content tracking can have one), so I added it as parameter. If someone is interested in those additional tests, they can be found here.

I also added search and outlink tracking to the example (because I wanted to see how it looks like in the dashboard), and fixed a small macro mistake.

Finally I want to propose to rename trackScreen to trackPageView and trackScreenWithName to trackPageViewWithName since the documentation always refers to the thing they track as page views. This would also imply changing screenId in MatomoAction to pvId.