trackCustomDimension
The trackCustomDimension() method sets a value for the custom dimension. The value can be sent to Piwik PRO with a screen view or other event.
Syntax
await FlutterPiwikPro.sharedInstance.trackCustomDimension(id: customDimensionId, value: 'customDimensionValue');
Parameters
customDimensionId (number, required)
The ID of the custom dimension.
customDimensionValue (string, required)
The value of the custom dimension.
Examples
To set a custom dimension with the ID 1
and the value 5 stars
and send it with a screen view:
await FlutterPiwikPro.sharedInstance.trackCustomDimension(id: 1, value: '5 stars');
To set a custom dimension with the ID 2
and the value paid subscriber
and send it with an event:
await FlutterPiwikPro.sharedInstance.trackCustomDimension(id: 2, value: 'paid subscriber');
Notes
- After a dimension is sent with an event, it is deleted and will not be sent with the next event. So, you have to set it each time you want to send it.
Updated 6 days ago