poitch / dart-matomo

A Dart Matomo Client
MIT License
20 stars 39 forks source link

Custom Dimensions for A-B testing #24

Open teolemon opened 3 years ago

teolemon commented 3 years ago

What

The API documentation mentions custom dimensions

Why

That could be put to use for experimentation frameworks and A/B testing if I'm not mistaken (still relatively new to Matomo and Dart). Is that parameter something within the scope of the plugin ? https://developer.matomo.org/api-reference/tracking-api#optional-user-info

API parameters

dimension[0-999] — A Custom Dimension value for a specific Custom Dimension ID (requires Matomo 2.15.1 + Custom Dimensions plugin see the Custom Dimensions guide). If Custom Dimension ID is 2 use dimension2=dimensionValue to send a value for this dimension. The configured Custom Dimension has to be in scope "Visit".

poitch commented 3 years ago

It looks like Custom Dimension is now part of Matomo 4, so this fits into this plugin.

A dimension is apparently defined at a visit level, so the dimensions would have to be provided during initialization. However, I could imagine a dedicated call could be added, knowing that there could be some timing issues.