RFM analysis

Published December 20, 2021
Modules
Difficulty
Selected Clients
carrefour logoeobuwie logo

RFM segmentation is a method used to identify clusters of customers for special treatment. It is commonly used in database marketing and direct marketing, and has received particular attention in many different industries. In order to differentiate customers from data sets, the RFM method uses three different attributes:

  • Recency of the last purchase (R) - refers to the interval between the time of the latest customer purchase and the current date. The shorter the interval between current date and last purchase, the higher R score is.
  • Frequency of the purchases (F) - refers to the number of transactions in a particular period. The higher number of transactions, the higher the F score is.
  • Monetary value of the purchases (M) - refers to monetary value of products purchased by the customer. The more the customer spends, the higher the M score is.

This lets you isolate groups, identify new or most active customers, and target personalized messages based on transaction data.

RFM analysis

Prerequisites


  • Come up with the categories you want to organize your customers, for example: Top customers, Recent customers, Churn risk, Heavy buyers, Lost heavy buyers, Lost customers.

Process


  1. Create some basic analyses for later use in more complex calculations.
  2. Create a set of metrics for Recency, Frequency, and Monetary scores to return the value of 0.20, 0.40, 0.60, 0.80 quantiles. This way you receive four thresholds for all scores.
  3. Prepare segmentations for Recency, Frequency, and Monetary scores based on the values returned by the metrics you created before. The segments in these segmentations are named in the following way:
    • For Recency score: 500, 400, 300, 200, 100
    • For Frequency score: 50, 40, 30, 20, 10
    • For Monetary score: 5, 4, 3, 2, 1
  4. Create an expression that adds all three segmentations, the example result is 555, which is the highest score a customer can get.
  5. Create a RFM segmentation that contains the segments which correspond to the customer categories (for example, Top customers, Heavy buyers, Lost customers, and so on). Define the range of scores for each category.
  6. Create a workflow which automates the process of updating the values of the quantile calculation metrics used in the Recency, Frequency, and Monetary segments. Such automation will ensure that you are always operating with the most up-to-date metrics, maintaining an appropriate range between all segments.
  7. Create a dashboard to conveniently display the results of the metrics.
Note: You can find furhter explanation in the corresponding sections in the article.

Create a set of basic analyses


In this part of the process, you must create a number of analyses which will be reused later in the process.

Number of transactions

Create the aggregate that calculates the number of transactions for a single customer. It will be reused in the further analyses.

Note: The time ranges used in this use case are just an example. Apply such time ranges that suit your business needs.
Tip: You can read more about aggregates here.
  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Set the Analyze profiles by option to Count.
  5. Click the Choose event dropdown list.
  6. From the dropdown list, select the event that signifies a purchase.
    Tip: Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
  7. Using the date picker in the lower-right corner, set the time range to Lifetime.
  8. Save the aggregate.
The aggregate that returns the number of transactions for a customer
The aggregate that returns the number of transactions for a customer

Time of the first purchase

Create the aggregate which returns the time when a customer made the first purchase. It will be reused in the further analyses.

  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Set the Analyze profiles by option to First.
  5. Click the Choose event dropdown list.
  6. From the dropdown list, select the event that signifies a purchase.
    Tip: Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
  7. Click + where button.
  8. On the dropdown list, click Three dot icon > Specials.
  9. Choose TIMESTAMP.
  10. Using the date picker in the lower-right corner, set the time range to Lifetime.
  11. Save the aggregate.
The aggregate that returns the time of first transaction of a customer
The aggregate that returns the time of first transaction of a customer

Time of the last purchase

Create the aggregate which returns the time when a customer made the latest purchase. It will be reused in the further analyses.

  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Set the Analyze profiles by option to Last.
  5. Click the Choose event dropdown list.
  6. From the dropdown list, select the event that signifies a purchase.
    Tip: Events may have different labels between workspaces , but you can always find them by their action name (in this step, it’s transaction.charge).
  7. Click + where button.
  8. On the dropdown list, click Three dot icon > Specials.
  9. Choose TIMESTAMP.
  10. Using the date picker in the lower-right corner, set the time range to Lifetime.
  11. Save the aggregate.
The aggregate that returns the time of last transaction for a customer
The aggregate that returns the time of last transaction for a customer

Value of purchase

Create the aggregate that returns the total amount of money a single customer spent.

  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Set the Analyze profiles by option to Sum.
  5. Click the Choose event dropdown list.
  6. From the dropdown list, select the event that signifies a purchase.
    Tip: Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
  7. Click + where button.
  8. On the dropdown list, select the parameter that signifies the total amount of a transaction, for example, $totalAmount
  9. Using the date picker in the lower-right corner, set the time range to Lifetime.
  10. Save the aggregate.
The aggregate that returns the total amount of money a customer spent
The aggregate that returns the total amount of money a customer spent

Number of days since last transaction

Create an attribute expression that calculates how many days passed since the last transaction. This expression reuses the aggregate that returns the timestamp of the last transaction in the last 90 days.

  1. Go to Analytics icon Analytics > Expressions > New expression.

  2. Enter a meaningful name of the expression.

  3. Leave the expression type at default (Attribute).

  4. Build the following expression formula:

    The expression formula that returns the number of days that passed since the last transaction
    The expression formula that returns the number of days that passed since the last transaction
    Click here to watch the video tutorial

    In the formula of the expression, you must deduct the date of the last transaction from the current date and divide the result by 86400000 to receive the number of days which passed since the last purchase.

  5. Save the expression.

Number of days since the first transaction

Create an attribute expression that calculates how much time passed since the first transaction. This expression reuses the aggregate that returns the timestamp of the first transaction in the last 90 days and it will be reused in the expression that returns the number of weeks that passed from the first transaction.

  1. Go to Analytics icon Analytics > Expressions > New expression.

  2. Enter a meaningful name of the expression.

  3. Leave the expression type at default (Attribute).

  4. Build the following expression formula:

    The expression formula that returns the time that passed since the first transaction
    The expression formula that returns the time that passed since the first transaction
    Click here to watch the video tutorial

    In the formula of the expression, you must deduct the date of the first transaction from the current date. The result of the expression is given in milliseconds.

  5. Save the expression.

Weeks from the first transaction

Create an expression that calculates the number of weeks since the first transaction of a customer in the last 90 days. This expression reuses the expression that calculates the time from the first transaction.

  1. Go to Analytics icon Analytics > Expressions > New expression.
  2. Enter a meaningful name of the expression.
  3. Leave the expression type at default (Attribute).
  4. Build the following expression formula:
    1. Click the Select node.
    2. From the dropdown list, select Customer.
    3. Click the unnamed node that has been added to the canvas.
    4. Scroll down the page and click Choose attribute.
    5. Search and select the expression that calculates the time from the first transaction.
    6. Next to the expression on the canvas, click the plus button icon.
    7. Select Constant.
    8. Click 0 that has been added to the canvas.
    9. Change the number to 604800000.
    10. Click the mathematical operator between the nodes and change it to a division sign.
  5. Save the expression.
The expression formula that returns the number of weeks that passed since the first transaction
The expression formula that returns the number of weeks that passed since the first transaction

Average number of transactions per week

Create an expression that calculates the average number of transactions a customer made per week in the last 90 days. This expression reuses the aggregate that calculates the number of transactions in the last 90 days and the expression that calculates the number of weeks since the first transaction in the last 90 days.

  1. Go to Analytics icon Analytics > Expressions > New expression.
  2. Enter a meaningful name of the expression.
  3. Leave the expression type at default (Attribute).
  4. Build the following expression formula:
    1. Click the Select node.
    2. From the dropdown list, select Customer.
    3. Click the unnamed node that has been added to the canvas.
    4. Scroll down the page and click Choose attribute.
    5. Search and select the aggregate that calculates the number of transactions.
    6. Next to the expression on the canvas, click the plus button icon.
    7. Select Customer.
    8. Click the unnamed node that has been added to the canvas.
    9. Scroll down the page and click Choose attribute.
    10. Search and select the expression that calculates weeks from first transactions.
    11. Click the mathematical operator between the nodes and change it to a division sign.
  5. Save the expression.
The expression formula that returns the average number of transactions per week
The expression formula that returns the average number of transactions per week

Create metrics


In this part of the process, prepare metrics which will calculate the following quantiles: 0.80, 0.60, 0.40, 0.20 for the values of the expressions and an aggregate:

Create four metrics for each score (which means that in total you will create 12 metrics). This way, you can distinguish tresholds for Recency, Frequency, and Monetary scores.

Recency score

  1. Go to Analytics icon Analytics > Metrics > New metric.

  2. Enter a meaningful metric name.

  3. Leave the metric kind at default (Simple).

  4. Change the Metric type to Customer.

  5. Change the Aggregator option to Quantile.

  6. Next to the Quantile option, in the text field, enter 0.80.

  7. Click Choose value.

  8. Search and select the expression that returns the number of days that passed since the last transaction.

  9. Click Enable filter.

  10. Click Choose filter.

  11. Search and select the transaction.charge event.

  12. Set the time range to Lifetime.

  13. Confirm the filter settings by clicking Apply.

  14. Save the metric.

  15. Create three metrics with the same settings for the following quantile values: 0.60, 0.40, and 0.20.

    The metric that calculates 0.80 quantile of the expression
    The metric that calculates 0.80 quantile of the expression

Frequency score

  1. Go to Analytics icon Analytics > Metrics > New metric.
  2. Enter a meaningful metric name.
  3. Leave the metric kind at default (Simple).
  4. Change the Metric type to Customer.
  5. Change the Aggregator option to Quantile.
  6. Next to the Quantile option, in the text field, enter 0.20.
  7. Click Choose value.
  8. Search and select the expression that returns the average number of transactions in a week.
  9. Click Enable filter.
  10. Click Choose filter.
  11. Search and select the transaction.charge event.
  12. Set the time range to Lifetime.
  13. Confirm the filter settings by clicking Apply.
  14. Save the metric.
  15. Create three metrics with the same settings for the following quantile values: 0.40, 0.60, and 0.80.
The metric that calculates 0.20 quantile of the expression
The metric that calculates 0.20 quantile of the expression

Monetary score

  1. Go to Analytics icon Analytics > Metrics > New metric.
  2. Enter a meaningful metric name.
  3. Leave the metric kind at default (Simple).
  4. Change the Metric type to Customer.
  5. Change the Aggregator option to Quantile.
  6. Next to the Quantile option, in the text field, enter 0.20.
  7. Click Choose value.
  8. Search and select the aggregate that returns the value of purchases in last 90 days.
  9. Click Enable filter.
  10. Click Choose filter.
  11. Search and select the transaction.charge event.
  12. Set the time range to Lifetime.
  13. Confirm the filter settings by clicking Apply.
  14. Save the metric.
  15. Create three metrics with the same settings for the following quantile values: 0.40, 0.60, and 0.80.
The metric that calculates 0.20 quantile of the expression
The metric that calculates 0.20 quantile of the aggregate

Create segmentations


Based on the values returned by the metrics you created before, create three segmentations for Recency, Frequency and Monetary scores. Each of the segmentation contains 5 segments. Each segment reuses the result of a quantile calculated by the metrics.

The segments are named in the following way:

  • For Recency score: 500, 400, 300, 200, 100
Segment 500 400 300 200 100
Conditions The value lower than
the 0.20 quantile
The value lower than
the 0.40 quantile but higher than 0.20 quantile
The value lower than
the 0.60 quantile but higher than 0.40 quantile
The value lower than
the 0.80 quantile but higher than 0.60 quantile
The value higer than 0.80
quantile
  • For Frequency score: 50, 40, 30, 20, 10
Segment 50 40 30 20 10
Conditions The value higher than
0.80 quantile
The value lower than
0.80 quantile but higher than 0.60 quantile
The value lower than
0.60 quantile but higher than 0.4 quantile
The value lower than
0.40 quantile but higher than 0.20 quantile
The value lower than 0.20
quantile
  • For Monetary score: 5, 4, 3, 2, 1
Segment 5 4 3 2 1
Conditions The value higher than
0.80 quantile
The value lower than
0.80 quantile but higher than 0.60 quantile
The value lower than
0.60 quantile but higher than 0.4 quantile
The value lower than
0.40 quantile but higher than 0.20 quantile
The value lower than 0.20
quantile

Customers belong to a specific segment under defined circumstances and based on the segment classification the overall score will be created, for example, a customer can belong to the following segments: 500 (R), 20 (F), 3 (M). In the next part of the process, these values will be added in an expression to produce the final RFM score, which in this example will be 523.

Recency

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter a meaningful name of the segmentation.
  3. As the name of the segment, enter 500.
  4. Click Add condition.
  5. Search and select the expression that returns the number of days since the last transaction.
  6. As the logical operator select Less than.
  7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the 0.20 quantile. In this use case, the quantile result amounts to 43.3, so the customers who made a transaction less than 43 days after the date of the last transaction, belong to 500. It means that the R score of the customer is 500, which is the highest.
  8. Add the rest of segments by clicking the Analytics icon icon.
  9. For the following segments, add the conditions listed below:
    • For the 400 segment: more than the value of the 0.20 quantile AND less than 0.40 quantile
    • For the 300 segment: more than the value of the 0.40 quantile AND less than 0.60 quantile
    • For the 200 segment: more than the value of the 0.60 quantile AND less than 0.80 quantile
    • For the 100 segment: less than the value of the 0.80 quantile AND segment of loyal customers AND add the transaction.charge event with the Lifetime time range.
    The configuration of the Recency score segmentation
    The configuration of the Recency score segmentation

Frequency

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter a meaningful name of the segmentation.
  3. As the name of the segment, enter 50.
  4. Click Add condition.
  5. Search and select the expression that returns the average number of transactions per week.
  6. As the logical operator select More than or equal.
  7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the 0.80 quantile. In this use case, the quantile result amounts to 0.4, so the customers who make more than 0.4 transaction a week, belong to 50. It means that the F score of the customer is 50, which is the highest.
  8. Add the rest of segments by clicking the Analytics icon icon.
  9. For the following segments, add the conditions listed below:
    • For the 40 segment: more than the value of the 0.60 quantile AND less than 0.80 quantile
    • For the 30 segment: more than the value of the 0.40 quantile AND less than 0.60 quantile
    • For the 20 segment: more than the value of the 0.20 quantile AND less than 0.40 quantile
    • For the 10 segment: less than the value of the 0.20 quantile AND segment of loyal customers AND add the transaction.charge event with the Lifetime time range.
    The configuration of the Frequency score segmentation
    The configuration of the Frequency segmentation

Monetary

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter a meaningful name of the segmentation.
  3. As the name of the segment, enter 5.
  4. Click Add condition.
  5. Search and select the aggregate that returns the value of transactions.
  6. As the logical operator select More than or equal.
  7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the 0.80 quantile. In this use case, the quantile result amounts to 2243 PLN, so the customers who spent this amount of money or more, belong to 5. It means that the M score of the customer is 5, which is the highest.
  8. Add the rest of segments by clicking the Analytics icon icon.
  9. For the following segments, add the conditions listed below:
    • For the 4 segment: more than the value of the 0.60 quantile AND less than 0.80 quantile
    • For the 3 segment: more than the value of the 0.40 quantile AND less than 0.60 quantile
    • For the 2 segment: more than the value of the 0.20 quantile AND less than 0.40 quantile
    • For the 1 segment: less than the value of the 0.20 quantile AND add the transaction.charge event with the Lifetime time range.
    The configuration of the Monetary score segmentation
    The configuration of the Monetary segmentation

Create an expression


In this part of the process, create an expression that adds the segmentations a customer belongs to, in order to produce the final RFM score.

  1. Go to Analytics icon Analytics > Expressions > New expression.
  2. Enter a meaningful name of the expression.
  3. Leave the expression type at default (Attribute).
  4. Build the formula of the expression that adds the three segmentations you created in the previous part of the procedure.
    1. Click the Select node.
    2. From the dropdown list, select Customer.
    3. Click the unnamed node that appeared on the canvas.
    4. Scroll down the page and click Choose attribute.
    5. On the dropdown list select the Recency segmentation.
    6. Next to the segmentation added to the canvas, click the plus button.
    7. Repeat steps from 1 to 6 for the Frequency and Monetary segmentations.
    8. Click the mathematical operator between the nodes and change it to a plus sign.
      The configuration of the expression
      The configuration of the expression
  5. Save the expression.
    Result: The table below contains all possible results:
Possible results
111, 112, 113, 114, 115, 121, 122, 123, 124, 125,131, 132, 133, 134, 135, 141, 142, 143, 144, 145, 151, 152, 153, 154, 155, 211, 212, 213, 214, 215, 221, 222, 223, 224, 225, 231, 232, 233, 234, 235, 241, 242, 243, 244, 245, 251, 252, 253, 254, 255, 311, 312, 313, 314, 315, 321, 322, 323, 324, 325, 331, 332, 333, 334, 335, 341, 342, 343, 344, 345, 351, 352, 353, 354, 355, 411, 412, 413, 414, 415, 421, 422, 423, 424, 425, 431, 432, 433, 434, 435, 441, 442, 443, 444, 445, 451, 452, 453, 454, 455, 511, 512, 513, 514, 515, 521, 522, 523, 524, 525, 531, 532, 533, 534, 535, 541, 542, 543, 544, 545, 551, 552, 553, 554, 555

You need to come up with categories of the customers and assign the results to the specific category. Example categories can be: Top customers, Recent customers, Churn risk, Heavy buyers, Lost heavy buyers, Lost customers.

Create a RFM segmentation


In the final part of the process, create a segmentation that contains segments. Each segment represents a category of customers. As the condition for each segment, use the expression created in the previous part of the process and define the scores that fall into a particular category.

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.

  2. Enter a meaningful title of the segmentation.

  3. Click Add condition.

  4. On the dropdown list, search and select the expression created in the previous part of the process.

  5. As the logical operator, select In.

  6. Enter the score that fall into a category.

  7. Click the Analytics icon icon.

  8. Repeat steps from 3 to 7 for the rest of the categories.

    The configuration of the RFM segmentation
    The configuration of the RFM segmentation
  9. Save the segmentation.

    Example preview of the RFM analysis
    Example preview of the RFM analysis

Create a workflow


Create a workflow which automates the process of updating the values of the quantile calculation metrics used in the Recency, Frequency, and Monetary segmentations. These segmentations will be updated using webhooks, where each webhook is dedicated to updating the value of the metrics in one segmentation.

Before you start creating a workflow, create a test user that you will later use in the trigger node. All webhook responses will be sent to this profile, this way you will be able to check if the update was successful.

  1. Go to Automation icon Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Define the Audience node


Choose the Audience node as the trigger. In this step, you will select a test user for whom the automation will be run.

  1. Start the workflow with the Audience node.
  2. In the configuration of the node, set the Run trigger option to repeatable.
  3. Set the interval to 1 per day.
  4. Choose the day and time when the process starts.
  5. Select the time zone.
  6. In Define audience, choose New Audience and click Define conditions.
    1. As the first condition, from Choose filter dropdown menu, choose Email address attribute.
      Note: You may have a different naming for the attribute responsible for the email address. Choose the attribute you use for this purpose.
    2. From the Choose operator dropdown list, select Equal.
    3. In the right field, enter the email address of your test user.
    4. Click Apply.
  7. Add the Split Path node.

Outgoing Integration


  1. Add the Outgoing Integration node, which will update the value of metrics used in the Recency score segmentation.
  2. In the configuration of the node:
    1. Enter the title of the Outgoing Integration node.
    2. In the Webhook name field, enter the webhook name (it will be visible as the action.name parameter in the webhook.response event which will be available in the profile of your test user).
    3. Select the PUT method.
    4. In the URL of the endpoint, enter the endpoint for the segmentation update: https://api.synerise.com/analytics-backend/analytics/v2/segmentations/f08a0f4d-4209-40cc-bfe9-4734cd9e0db9.
    5. Replace the segmentation ID in this endpoint (f08a0f4d-4209-40cc-bfe9-4734cd9e0db9) with the ID of the Recency score segmentation.
    6. Enter the body of the request.
      In the body, you need to add the payload of the segmentation you want to update. To get the payload perform the following steps:
      1. Open the respective segmentation.
      2. Open console and go to the Network tab.
      3. Refresh the page.
      4. Search for preview in the Network.
      5. Right click and copy the object.
        Click here to see the console view

        How to copy an object of segmentation
        How to copy an object of segmentation

      6. In the copied body replace all constant values with the dynamic values of relevant metrics.
        Example:
        You have the folowing constant: “constant”: 43.3
        43.3 should be replaced in this case with the relevant metric ID. You can additionally round the value of the metric to three decimal places. The final appearance of the substituted constant will look as follows:
                "constant":  {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
        Click here to see the example of body request for the Recency segment

        {
            "analysis": {
                "title": "[UC] RFM - Recency Score",
                "description": "",
                "segments": [
                    {
                        "title": "500",
                        "description": "",
                        "filter": {
                            "matching": true,
                            "expressions": [
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
        
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            ],
                            "expression": {
                                "name": "",
                                "type": "ATTRIBUTE",
                                "matching": true,
                                "attribute": {
                                    "expressions": [
                                        {
                                            "constraint": {
                                                "type": "NUMBER_ONE",
                                                "logic": "LESS",
                                                "value": {
                                                    "type": "CONSTANT",
                                                    "constant": {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
        
                                                }
                                            },
                                            "attribute": {
                                                "type": "EXPRESSION",
                                                "id": "73d13360-2074-463c-9978-79861889dff0"
                                            }
                                        }
                                    ]
                                }
                            }
                        },
                        "profileMetrics": []
                    },
                    {
                        "title": "400",
                        "description": "",
                        "filter": {
                            "matching": true,
                            "expressions": [
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
        
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                {
                                    "type": "OPERATOR",
                                    "logic": "AND"
                                },
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
        
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            ],
                            "expression": {
                                "type": "FUNCTION",
                                "function": "AND",
                                "arg1": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
        
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                "arg2": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "profileMetrics": []
                    },
                    {
                        "title": "300",
                        "description": "",
                        "filter": {
                            "matching": true,
                            "expressions": [
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                {
                                    "type": "OPERATOR",
                                    "logic": "AND"
                                },
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            ],
                            "expression": {
                                "type": "FUNCTION",
                                "function": "AND",
                                "arg1": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                "arg2": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "profileMetrics": []
                    },
                    {
                        "title": "200",
                        "description": "",
                        "filter": {
                            "matching": true,
                            "expressions": [
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                {
                                    "type": "OPERATOR",
                                    "logic": "AND"
                                },
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            ],
                            "expression": {
                                "type": "FUNCTION",
                                "function": "AND",
                                "arg1": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "LESS",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                "arg2": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "profileMetrics": []
                    },
                    {
                        "title": "100",
                        "description": "",
                        "filter": {
                            "matching": true,
                            "expressions": [
                                {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                },
                                {
                                    "type": "OPERATOR",
                                    "logic": "AND"
                                },
                                {
                                    "name": "",
                                    "type": "FUNNEL",
                                    "matching": true,
                                    "funnel": {
                                        "title": "unnamed",
                                        "completedWithin": {},
                                        "dateFilter": {
                                            "type": "ABSOLUTE"
                                        },
                                        "steps": [
                                            {
                                                "action": {
                                                    "id": 68600,
                                                    "name": "transaction.charge"
                                                },
                                                "title": "Unnamed Step",
                                                "expressions": [],
                                                "eventName": "transaction.charge"
                                            }
                                        ],
                                        "exact": false
                                    }
                                }
                            ],
                            "expression": {
                                "type": "FUNCTION",
                                "function": "AND",
                                "arg1": {
                                    "name": "",
                                    "type": "FUNNEL",
                                    "matching": true,
                                    "funnel": {
                                        "title": "unnamed",
                                        "completedWithin": null,
                                        "dateFilter": {
                                            "type": "ABSOLUTE"
                                        },
                                        "steps": [
                                            {
                                                "action": {
                                                    "id": 68600,
                                                    "name": "transaction.charge"
                                                },
                                                "title": "Unnamed Step",
                                                "expressions": [],
                                                "eventName": "transaction.charge"
                                            }
                                        ],
                                        "exact": false
                                    }
                                },
                                "arg2": {
                                    "name": "",
                                    "type": "ATTRIBUTE",
                                    "matching": true,
                                    "attribute": {
                                        "expressions": [
                                            {
                                                "constraint": {
                                                    "type": "NUMBER_ONE",
                                                    "logic": "MORE_OR_EQUAL",
                                                    "value": {
                                                        "type": "CONSTANT",
                                                        "constant": {% metricsvar  metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} 
                                                    }
                                                },
                                                "attribute": {
                                                    "type": "EXPRESSION",
                                                    "id": "73d13360-2074-463c-9978-79861889dff0"
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "profileMetrics": []
                    }
                ],
                "unique": true
            },
            "allowNull": true
        }

        Note: This is just an example of the body we are using in this use case, and it contains all the metrics IDs that were created in the previous steps. If your analytics settings differ from the configuration shown in this use case, you will have a different body that matches your custom settings.
      7. In the Authorization section, select by API key as your method of authorization.
      8. From the dropdown list below, select your API key.
    7. Click Apply.
The view of the Outgoing Integration node configuration
Configuration of the Outgoing Integration node

Configure two Outgoing Integration nodes for the remaining Frequency and Monetary segments. Follow the steps described for the configuration of the Outgoing Integration node for the Recency score segmantation, but make sure to adjust the configuration for each specific segment.

Add the Merge Paths node and the End node.

The workflow continuously updates the metrics in the segmentations at a set frequency, ensuring that all segmentations remain up-to-date.

Final workflow setup view
Final workflow setup view

Create a dashboard


In this part of the process, to conveniently preview the results of all metrics you created in the previous part of the process, create a dashboard.

  1. Go to Analytics icon Analytics > Dashboard > New dashboard.
  2. Enter a meaningful name of the dashboard.
  3. Add all metrics you created earlier in the process.
    Tip: You can learn more about creating dashboards here.
  4. Save the dashboard.
    The example dashboard
    The example dashboard

Check the use case set up on the Synerise demo workspace


Check the analytics from our use case in Synerise demo workspace:

  • Aggregate which counts transactions,
  • Aggregate counts first transactions,
  • Aggregate counts last transactions,
  • Aggregate presented monetary value,
  • Expression counts days from last transaction,
  • Expression that calculates how much time passed since the first transaction,
  • Expression that calculates the number of weeks since the first transaction of a customer,
  • Expression that calculates the average number of transactions a customer made per week.

See the metrics which will calculate the qunatiles for the values of the expressions and an aggregate"

Check the dashboard presenting RFM summary.

Check three segments, created in this case:

Check the RFM general score and RFM segmentation.

Check the workflow.

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.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker