CustomMetrics
Returns all custom metrics created in the account.
Select
The add-in uses the Klaviyo API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client-side within the add-in.
- Id supports the following operator: =
For example, the following queries are processed server-side:
SELECT * FROM CustomMetrics WHERE Id = 'custom-metric-id'
Insert
You can create a new custom metric by using an INSERT statement.
INSERT INTO CustomMetrics (
Name,
DefinitionAggregationMethod,
DefinitionMetricGroupsMetrics
)
VALUES (
'my custom metric name',
'CustomMetricDefinitionAggregate',
'DefinitionMetricGroupsMetricsAggregate'
)
Update
You can update a custom metric by specifying the Id of the record and setting the Name field.
UPDATE CustomMetrics
SET Name = 'my custom metric new name'
WHERE Id = 'custom-metric-id'
Delete
You can delete a custom metric by specifying the Id of the record you want to remove.
DELETE FROM CustomMetrics
WHERE Id = 'custom-metric-id'
Columns
| Name | Type | ReadOnly | References | Description | |
| Id [KEY] | String | True |
The Id of the custom metric. | ||
| Created | Datetime | True |
The datetime when this custom metric was created. | ||
| Name | String | False |
The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code. | ||
| Updated | Datetime | True |
The datetime when this custom metric was updated. | ||
| DefinitionAggregationMethod | String | False |
Method of aggregation for custom metric measurements. If a metric has a value aggregation method, it will be treated as a revenue metric, such as a Placed Order metric. If a metric has a count aggregation method, it will only be able to report on conversions like an Active on Site metric. | ||
| DefinitionMetricGroupsMetrics | String | False |
The metric groups associated with this custom metric. |