Export multiple metrics with dynamic key
Efficiently managing and analyzing metrics is crucial for optimizing operations and making informed decisions. However, manually creating and maintaining separate metrics for different brands, segments, or reporting needs can be time-consuming and complex. Simplify the process with dynamic keys and reduce the number of metrics required to build reports.
In this use case, we will export three metrics for two different brands to Amazon S3 - with a total of six results. We want to report on the sales volume of products in a given category and brand, as well as the number of products sold for the previous week. The metrics and dynamic keys used in this use case are only an example. You can export any other metrics with dynamic keys as needed, the value of the dynamic key can be static or dynamic (Jinjava).
Prerequisites
- You must have an account on AWS.
- You must be granted a user role that includes the
Data export > Export metrics result
permission.
Process
In this use case, you will go through the following steps:
- Create metrics with dynamic key for value of sold products and number of sold products from a specific category, value of products sold from a particular brand.
- Create a workflow sending two different metric reports to Amazon S3.
Create metrics
In this part of the process, you will create three metrics for the product.buy
event.
Value of products sold from a category
- Go to
Analytics > Metrics > New metric.
- Enter the name of the metric.
- As a metric kind, select Simple metric.
- As the type, set Event.
- As the aggregator, set Sum.
- As the occurrence type, set All.
- From the Choose event dropdown list, select
product.buy
. - From the Choose parameter dropdown list, select the
finalUnitPrice
parameter. - Click the + where button.
- From the Choose parameter dropdown list, select the
category
parameter. - From the Choose operator dropdown list, choose String, and then select Equal.
- Next to the operator, click the
icon until you get two fields: Dynamic key and Value.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
productCategory
. The value for the key will be sourced from thecategory
parameter. - In the Value field, enter
none
.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
- To select a specific time range, click the calendar icon. In our case, it will be Last week. Confirm your choice with the Apply button.
- Click Save.

Number of products sold from a category
- Go to
Analytics > Metrics > New metric.
- Enter the name of the metric.
- As a metric kind, select Simple metric.
- As the type, set Event.
- As the aggregator, set Sum.
- As the occurrence type, set All.
- From the Choose event dropdown list, select
product.buy
. - From the Choose parameter dropdown list, select the
quantity
parameter. - Click the + where button.
- From the Choose parameter dropdown list, select the
category
parameter. - From the Choose operator dropdown list, choose String, and then select Equal.
- Next to the operator, click the
icon until you get two fields: Dynamic key and Value.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
productCategory
. The value for the key will be sourced from thecategory
parameter. - In the Value field, enter
none
.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
- To select a specific time range, click the calendar icon. In our case, it will be Last week. Confirm your choice with the Apply button.
- Click Save.

Value of products sold from a brand
- Go to
Analytics > Metrics > New metric.
- Enter the name of the metric.
- As a metric kind, select Simple metric.
- As the type, set Event.
- As the aggregator, set Sum.
- As the occurrence type, set All.
- From the Choose event dropdown list, select
product.buy
. - From the Choose parameter dropdown list, select the
finalUnitPrice
parameter. - Click the + where button.
- From the Choose parameter dropdown list, select the
brand
parameter. - From the Choose operator dropdown list, choose String, and then select Equal.
- Next to the operator, click the
icon until you get two fields: Dynamic key and Value.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
brandName
. The value for the key will be sourced from thebrand
parameter. - In the Value field, enter
none
.
- In the Dynamic key field, enter the name of the dynamic key, in our case:
- To select a specific time range, click the calendar icon. In our case, it will be Last week. Confirm your choice with the Apply button.
- Click Save.

Create a workflow
Create a workflow that sends the metrics data for two different brands to Amazon S3 once a week.
- Go to
Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the Scheduled Run trigger node
At this stage, configure the conditions that trigger the workflow.
- As the trigger node, select Scheduled Run.
- In the configuration of the node:
- Leave the Run trigger option at default (all time).
- Select the timezone in which the workflow will be launched.
- To launch the workflow every week at the defined time, click the Every week tab below.
- Select the desired day, in our case Monday.
- Click Add time and set it according to your needs, in our case to
9:45
. - Confirm by clicking Apply.
Configure the Get Metrics node
As the next node, choose Get Metrics to retrieve metrics for specific categories and brand.
- Optionally, in the Time range field, on the calendar, select the time range from which you want to get the results of the metric or metrics. The time range you select will override the original time range settings of the metrics.
- In the Select metrics field, select metrics created in the previous part of the process.
- In the Dynamic keys section:
- in the brandName, enter the name of the brand
- in the productCategory, enter the name of the category
- Confirm by clicking Apply.

Configure Send file to Amazon S3 Bucket node
-
Click Amazon S3 Bucket > Send File.
-
Click Select connection.
-
From the dropdown list, select the connection.
- If no connections are available or you want to create a new one, see Create a connection.
- If you selected an existing connection, proceed with the integration settings.
-
In the Region field, enter the region of your bucket.
-
In the Bucket field, enter the name of an existing container in your storage.
-
In the Path to directory field, enter the path to the existing bucket in which the file will be saved.
-
In the File name field, enter the name of the file you want to send to the storage. If the file already exists, the contents of the file will be overwritten.
-
From the File format dropdown list, select the format in which the file will be saved in the storage.
-
Confirm by clicking Apply.
The configuration of the Send File node -
Repeat the configuration of the second Get Metrics node but for a different brand and Send file to Amazon S3 Bucket node.
Add the finishing node
-
Add the End node.
-
In the upper right corner, click Save & Run.
The workflow configuration
Check the use case set up on the Synerise Demo workspace
You can check the:
- Value of products sold from a category metric
- Number of products sold from a category metric
- Value of products sold from a brand metric
- Workflow
directly in Synerise Demo workspace.
If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.