This can be done either proactively (before events are sent in) or reactively (after events are sent in) - both incoming events and previous events which were not able to match to features will be processed against rules.

Steps

1. Click ‘Go to rules’

The button may instead say ‘View Rules’ if all events could be mapped to features.

2. Click ‘Create another rule’

3. Fill in the details of the rule

The following information is needed:

Rule Name

This is the name of the rule that will be visible on the Dashboard. Make it user friendly so that it’s easily understandable later exactly which event and feature this rule targets.

Conditions

You will see a box under ‘Map an event when’. These are where you will place your conditions to match events by in order to be mapped to a feature.

You can either select:

  • Event name: The name of the Segment track event (which is taken from the event field).

  • Property path: The name of a property sent in the Segment track event (all fields within the properties object). We require both the key of the property and the value of that property. The name can be a path if it’s nested in an object, such as object.name.

Segment Track Event Spec

See more on what a Segment track event looks like in the Segment docs.

If you need to add more conditions then hit the ’+’ button next to an existing condition.

An event can only have one name so only one event name can be specified as a condition.

Feature

You will see a dropdown under ‘Then record usage for’. This is where you will select the name of the feature which you want this rule to record usage events for.

Example

In our example, we can see that there is 1 unmapped event. This event has a name of Package Created and property named type which has a value of .

We have a consumable feature named ‘Add-on Packages’ which this event corresponds to as a package which is an add-on (as said by the type) has been created. Therefore we want to track that this feature has been used from this event and would put the following criteria:

4. Click ‘Create’

What next?

Congratulations 🎉 You’ve created a rule to map a Segment event to a feature.

Send in track events from Segment which match this rule and they will record feature usage for the given feature automatically!

Track Feature Usage (Segment)

I still see rules in the table which should have matched - is this expected?

Although the rule has now been created, it may take some time to reprocess your existing events against this rule. You may need to refresh the page and/or wait up to an hour to see these reflected - although times may vary based on how many events need to be processed.

If you see still see events that you think should have matched a rule after this, please write into the team and we’ll take a deeper look!