improved
Advanced Metrics
9 days ago by Nadia
We have released a new set of features for Custom Metrics. You can now:
- Use custom formulas for a metric value, incorporating aggregations, operators, and any schema field,
- Define multiple aggregations per metric;
- Exclude or include the current event from an aggregation calculation.
This unlocks a wide range of new use cases, including:
-
Ratio metrics:
- Calculate how the transaction amount compares to usual transactions for a user
current transaction / avg(transaction) [per user]
- Detect suspicious login activity by calculating the ratio of failed to succeeded logins
failed logins / succeeded logins per user
or the ratio of logins outside of usual countrieslogins outside of US / total logins
- Calculate how the transaction amount compares to usual transactions for a user
-
Time difference between events to detect quick actions:
- Detect if a transaction was attempted immediately after login
transaction [attempted] timestamp - last(successful login timestamp)
- Detect if a profile update was attempted immediately after login
profile update [attempted] timestamp - last(successful login timestamp)
- Detect if a transaction was attempted immediately after login
-
Threshold calculations for a policy acting as a limiter:
- Set a limit on the transaction amount allowed per day
transaction [attempted] amount + sum(transaction [succeeded] amount)
- Set a limit on the transaction amount allowed per day
You can find more details on the updated metrics documentation along with examples in the advanced metrics guide.