Metrics Tracking
Every feature flag that you create can have connected metrics that can be used to track strategic KPIs relating to the feature. These metrics can be used to track the performance of control vs variation in the case of testing rules, and can also be used to measure the impact of personalize and rollout campaigns.
For each feature flag, you need to define at least one "Primary Metric", and you can set up as many secondary metrics as you'd like.
Metrics in FME are based on "Custom Events" that you can create in VWO > Data360>Events. All the custom events created in Data360 will be available to be used as metrics in your feature flags.
Once you have configured custom events as metrics for your feature flag, you can then trigger a conversion for each metric using the following code snippet:
Usage
// Record an event/metric conversion for the given event name and context
VWOFme.trackEvent(eventName: "eventName", context: userContext)
// Record metric conversions for event with properties
let eventProperties: [String: Any] = ["cart_value":"999"]
VWOFme.trackEvent(eventName: "eventName", context: userContext, eventProperties: eventProperties)
trackEvent() Parameters
Parameter | Type | Description |
---|---|---|
event_name Required | String | The unique event name you will see when creating the event in Data360. When the trackEvent() function is called, it will record a metric conversion in VWO for the given event name. |
userContext Required | String | Same as the userContext object passed with the getFlag() function call (link). Read more about userContext here. |
eventProperties Optional | Object | any properties of this event that you wish to pass to VWO. E.g: for a "purchase" event, some properties could be "cartValue", "currency", "shippingMethod" etc. These must be passed as key-value pairs, and the property name should exactly match what you set while creating the event in VWO > Data360>Events. |
Updated 3 months ago