Cet article est disponible uniquement en anglais. Si vous avez besoin d'aide en français, n’hésitez pas à nous contacter.
How to access Rule-based metrics?
Click your avatar at the bottom of the page, then select Workspace Settings
From the navigation bar, select Metrics in the Workspace section.
How to create a rule-based metrics?
2. Configure the custom spend details:
Name the custom spend, e.g. Client spend
Add a description to provide essential context for other users and for SpyneAI
Enter a prefix, e.g. $,€,£
Enter a suffix, e.g. %, kg
Decimal places. The number of decimal places to display by default is 2.
3. Select Rule-based metrics
Set up rules
Click “+Add rues”
Specify the channel or channels (Meta, Google, Tiktok, etc.) to which the rule should be applied. You can create different rules for each channel or use the same across multiple channels.
Click on “+Add step”
Set up the conditions the rules apply to.
Each rule consists of the ‘when’ part specifies which campaign/ ad group/ ad the rule applies to, and the ‘then’ part specifies the expected results of the rule.
When
Define in which campaign name should the system look for information.
Then, set up the conditions.
Field value
Rules are applied to the field values. Several ways to identify the values that you want the system to extract.
Is in
It checks if the value matches any of the listed options.
Is not in
Contains: Check if a part of the text is found within the value.
Does not contain: Check if a part of the text is not found within the value.
Exacts: Check if the value is exactly as what is specified.
Matches regex: Use advanced text extraction and value settings with a full regex integration
Multiple conditions
You can combine multiple conditions with the “+ Add condition” button. Conditions can be combined as AND (both conditions must be true).
No condition
If you want the “then” without any condition, you can remove the “when” by clicking on the grey cross on the right.
Then
This part is mandatory, it specifies what the action / result of the rule should be.
Type a metric name, as you start typing a list of available metrics will appear. Select the metric that you want to add to the formula from the list.
Use operators (
+,-,*,/) and parentheses()by typing them directly from your keyboard, like regular text.To remove a metric, operator, or parenthesis, simply delete it like normal text editing.
You can add constant, for example you would type *100 to multiply by a hundred for a percentage.
For more complex formulas you can include parenthesis "()".
Formula validation
An error message will appear if the formula contains invalid characters or unmatched parentheses.
A formula cannot start or end with an operator (
+,-,*,/).
How to test rules and check the results?
You can check how the rules will apply to your custom metric over the last 30 days.
Click the button Test at the top right of the page. The test results will appear above the rules section.
Publish rule-based metric
Click on the 'Create custom metric' button at the top right of the page.
How to manage a rule-based metric ?
After the custom metric is published, it will appear in the table under the Custom Metrics section. To edit it, click the metric name in the table.
Or by selecting the ‘…’ menu in the header, you can edit, delete or duplicate the metric.
Update custom metric in case of changes
Click "Update metric" if you have made changes. Or, click on "Discard changes" if you do not want to save the changes.


















