Retrieving Journey and Conversion Statistics

The Customer Journey dashboard allows you to review journey overview information or drill down into detailed charts. For example, you can get information such as

  • completed goals
  • records completed
  • records jumped
  • growth rate

You can view sankey charts showing journey or activation conversion statistics.

This article provides details on how to retrieve journey and related Sankey chart statistics using the Journey Statistics endpoint.

INFO

Metrics get updated when a parent segment is updated.

This topic contains:

Prerequisites

Limitations

  • When a journey workflow starts running on one day and completes the next day, there will be a lag of one day in the statistics/metrics.

Retrieve Journey Statistics

You can retrieve Journey Statistics. Some sample statistics data are as follows:

  • Current number of profiles within the journey.
  • Number of profiles that exited or jumped from the journey.
  • Number of profiles that met the goal while in the journey.
  • Current number of profiles within each of the journey stages.
  • Number of profiles that exited or jumped from each of the journey stages.
  • Number of profiles that met the milestone of a stage while in the stage.

This example uses the following values:

Method GET
Endpoint [ https://{BaseUrl}/entities/journeys/:journeyId/:statistics ]
Header Authorization: TD1 1/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Header Content-Type: application/json
Parameter from — the starting date in format YYYY-MM-DD
to — the ending date in format YYYY-MM-DD

You can use a base URL that is optimal for your geographic location. For details, see Treasure Data Sites and baseURLs.

Sample RequestSample Response
Copy
Copied
curl --location --request GET 'https://api-cdp.treasuredata.com/entities/journeys/{journeyId}/statistics \
--header 'Accept: application/json' \
--header 'Authorization: TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
Copy
Copied
{
  "data": {
    "id": "journey_ID",
    "type": "journeyStatistic",
    "attributes": {
      "size": 293,
      "goalSize": 8,
      "enteredSize": 1489,
      "completionRate": 0.54,
      "exitOrJumpSize": 1188,
      "exitOrJumpRate": 79.79,
      "journeyStageStatistics": [
        {
          "id": "Stage ID",
          "enteredSize": 1025,
          "milestoneSize": 4,
          "completeMilestoneRate": 0.39,
          "exitOrJumpSize": 1013,
          "exitOrJumpRate": 98.83,
          "history": [
            {
              "updatedAt": "string",
              "journeyStageId": "Stage ID",
              "size": 738,
              "exitSizes": [
                0,
                114
              ],
              "entryInflux": 852,
              "milestoneInflux": 0,
              "exitInflux": 114,
              "jumpInflux": 0
            }
          ],
          "stepSizes": {
            "wait_step_UUID": 2,
            "jump_UUID": 0,
            "activation_UUID": 0
          },
          "size": 2
        },
        {
          "id": "Stage ID",
          "enteredSize": 164,
          "milestoneSize": 2,
          "completeMilestoneRate": 1.22,
          "exitOrJumpSize": 69,
          "exitOrJumpRate": 42.07,
          "history": [
            {
              "updatedAt": "string",
              "journeyStageId": "Stage ID",
              "size": 96,
              "exitSizes": [
                36
              ],
              "entryInflux": 138,
              "milestoneInflux": 0,
              "exitInflux": 36,
              "jumpInflux": 6
            }
          ],
          "stepSizes": {
            "wait_step_UUID": 0,
            "activation_UUID": 15,
            "jump_UUID": 0
          },
          "size": 89
        },
        {
          "id": "Stage ID",
          "enteredSize": 206,
          "milestoneSize": 2,
          "completeMilestoneRate": 0.97,
          "exitOrJumpSize": 0,
          "exitOrJumpRate": 0,
          "history": [
            {
              "updatedAt": "string",
              "journeyStageId": "Stage ID",
              "size": 202,
              "exitSizes": [],
              "entryInflux": 202,
              "milestoneInflux": 0,
              "exitInflux": 0,
              "jumpInflux": 0
            }
          ],
          "stepSizes": {
            "wait_step_UUID": 2,
            "activation_UUID": 200
          },
          "size": 202
        },
        {
          "id": "Stage ID",
          "enteredSize": 108,
          "milestoneSize": 0,
          "completeMilestoneRate": 0,
          "exitOrJumpSize": 106,
          "exitOrJumpRate": 98.15,
          "history": [
            {
              "updatedAt": "string",
              "journeyStageId": "Stage ID",
              "size": 102,
              "exitSizes": [
                0
              ],
              "entryInflux": 102,
              "milestoneInflux": 0,
              "exitInflux": 0,
              "jumpInflux": 0
            }
          ],
          "stepSizes": {
            "wait_step_UUID": 0,
            "activation_UUID": 0
          },
          "size": 0
        }
      ],
      "history": [
        {
          "updatedAt": "string",
          "size": 1138,
          "goalSize": 0,
          "entryInflux": 1294,
          "goalInflux": 0,
          "exitInflux": 150,
          "jumpInflux": 6
        }
      ]
    }
  }
}

About this request:

  • Replace {journeyId} with the journey ID for which you want to view metrics.
  • Replace {TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} with your personal API key.

About this response object:

  • You can fetch statistics of a journey for a preferred date range by appending from and to dates as query parameters in the request. For example, GET https://{BaseUrl}/entities/journeys/:journeyId/:statistics?to=YYYY-MM-DD&from=YYYY-MM-DD .

Retrieve Journey Conversion Sankey Chart Statistics

You can retreive the statistics of the Journey Conversion Sankey Chart. Some example statistics data are as follows:

Journey Conversion Statistic Description
Conversion to goal Number of profiles from each stage of the journey that met the journey goal
Conversion between stages Number of profiles that moved from one stage to another stage of the same journey
Conversion to jumps Number of profiles from each stage of the journey that jumped out of the journey and stage
Conversion to exits Number of profiles from each stage of the journey that exited the journey and stage by meeting the exit criteria in the journey stage
Sample RequestSample Response
Copy
Copied
curl --location --request GET 'https://api-cdp.treasuredata.com/entities/journeys/{journeyId}/conversion_sankey_charts \
--header 'Accept: application/json' \
--header 'Authorization: TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
Copy
Copied
{
  "data": [
    {
      "id": "ID",
      "type": "journeySankeyChart",
      "attributes": {
        "journeyId": "journey_ID",
        "journeyStageId": "Stage ID",
        "updatedAt": "2023-11-11T03:02:32.000Z",
        "chart": {
          "title": "Sankey Chart",
          "chartType": "sankey",
          "data": [
            {
              "label": "stage-{stage_id}",
              "value": {
                "id": "Stage ID",
                "name": "string",
                "type": "stage"
              }
            },
            {
              "label": "goal",
              "value": {
                "id": "goal",
                "name": "string",
                "type": "goal"
              }
            },
            {
              "label": "stage-{stage_id}",
              "value": {
                "id": "Stage ID",
                "name": "string",
                "type": "stage"
              }
            },
            {
              "label": "stage-{stage_id}",
              "value": {
                "id": "Stage ID",
                "name": "string",
                "type": "stage"
              }
            },
            {
              "label": "stage-{stage_id}",
              "value": {
                "id": "Stage ID",
                "name": "string",
                "type": "stage"
              }
            },
            {
              "label": "exit-{stage_id}-0",
              "value": {
                "id": "{stage_id}-0",
                "name": "Stale profiles",
                "type": "exit"
              }
            },
            {
              "label": "exit-{stage_id}-1",
              "value": {
                "id": "{stage_id}-1",
                "name": "string",
                "type": "exit"
              }
            },
            {
              "label": "exit-{stage_id}-0",
              "value": {
                "id": "{stage_id}-0",
                "name": "Untitled exit criteria 1",
                "type": "exit"
              }
            },
            {
              "label": "exit-{stage_id}-0",
              "value": {
                "id": "{stage_id}-0",
                "name": "Stale profiles",
                "type": "exit"
              }
            },
            {
              "label": "jump-{jump_1_uuid}",
              "value": {
                "id": "{jump_1_uuid}",
                "name": "string",
                "type": "jump"
              }
            },
            {
              "label": "jump-{jump_2_uuid}",
              "value": {
                "id": "{jump_2_uuid}",
                "name": "string",
                "type": "jump"
              }
            },
            {
              "label": "jump-{jump_3_uuid}",
              "value": {
                "id": "{jump_3_uuid}",
                "name": "string",
                "type": "jump"
              }
            }
          ],
          "metaData": {
            "links": [
              {
                "source": "stage-{stage_id}",
                "target": "goal",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "goal",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "goal",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "goal",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 2
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "stage-{stage_id}",
                "value": 1
              },
              {
                "source": "stage-{stage_id}",
                "target": "exit-{stage_id}-0",
                "value": 0
              },
              {
                "source": "stage-{stage_id}",
                "target": "exit-{stage_id}-1",
                "value": 115
              },
              {
                "source": "stage-{stage_id}",
                "target": "exit-{stage_id}-0",
                "value": 37
              },
              {
                "source": "stage-{stage_id}",
                "target": "exit-{stage_id}-0",
                "value": 101
              },
              {
                "source": "stage-{stage_id}",
                "target": "jump-{jump_1_uuid}",
                "value": 169
              },
              {
                "source": "stage-164385",
                "target": "jump-{jump_2_uuid}",
                "value": 2
              },
              {
                "source": "stage-164385",
                "target": "jump-{jump_3_uuid}",
                "value": 13
              }
            ]
          }
        }
      }
    }
  ]
}

About this request:

  • Replace {journeyId} with the journey ID for which you want to view metrics.
  • Replace {TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} with your personal API key.

Retrieve Activation Conversion Sankey Chart Statistics

You can retrieve the statistics of the Activation Conversion Sankey chart. For example, number of profiles that were activated by each activation in the journey stage that met goal, exited, jumped, moved to next stage (by meeting the stage milestone), and so on.

Sample RequestSample Response
Copy
Copied
curl --location --request GET 'https://api-cdp.treasuredata.com/entities/journeys/{journeyId}/activation_sankey_charts \
--header 'Accept: application/json' \
--header 'Authorization: TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
Copy
Copied
{
  "data": [
    {
      "attributes": {
        "updatedAt": "xxx",
        "journeyStageId": "Stage ID",
        "chart": {
          "title": "Journey Conversion",
          "chartType": "sankey",
          "data": [
            {
              "label": "activation-1",
              "value": {
                "id": "1",
                "type": "activation",
                "name": "Activation 1"
              }
            },
            {
              "label": "activation-2",
              "value": {
                "id": "2",
                "type": "activation",
                "name": "Activation 2"
              }
            },
            {
              "label": "goal",
              "value": {
                "type": "goal",
                "name": "Goal"
              }
            },
            {
              "label": "exit-1-1",
              "value": {
                "type": "exit"
              }
            },
            {
              "label": "jump-{jump_uuid}",
              "value": {
                "type": "jump"
              }
            }
          ],
          "metaData": {
            "links": [
              {
                "source": "activation-1",
                "target": "goal",
                "value": 8
              },
              {
                "source": "activation-2",
                "target": "goal",
                "value": 10
              },
              {
                "source": "activation-1",
                "target": "exit-1-1",
                "value": 5
              },
              {
                "source": "activation-2",
                "target": "exit-1-1",
                "value": 5
              },
              {
                "source": "activation-2",
                "target": "jump-{jump_uuid}",
                "value": 0
              }
            ]
          }
        }
      }
    }
  ]
}

About this request:

  • Replace {journeyId} with the journey ID for which you want to view metrics.
  • Replace {TD1 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} with your personal API key.