curl --request GET \
--url https://api.example.com/api/websites/:id/journey{
"data": {
"anchor": {
"type": "<string>",
"value": "<string>"
},
"direction": "<string>",
"max_depth": 123,
"total_anchor_sessions": 123,
"branches": [
{
"nodes": [
{}
],
"sessions": 123,
"share": 123
}
]
}
}Retrieve user journey paths showing which pages or events visitors navigate to before or after a specific anchor point.
curl --request GET \
--url https://api.example.com/api/websites/:id/journey{
"data": {
"anchor": {
"type": "<string>",
"value": "<string>"
},
"direction": "<string>",
"max_depth": 123,
"total_anchor_sessions": 123,
"branches": [
{
"nodes": [
{}
],
"sessions": 123,
"share": 123
}
]
}
}page or event.next (what happens after) or previous (what happens before).YYYY-MM-DD format.YYYY-MM-DD format.America/New_York). Required for accurate date boundary calculations.next or previous.curl -X GET "https://analytics.example.com/api/websites/abc123/journey?anchor_type=page&anchor_value=/pricing&direction=next&max_depth=3&start_date=2024-03-01&end_date=2024-03-07&timezone=America/New_York" \
-H "Authorization: Bearer spk_live_your_api_key"
{
"data": {
"anchor": {
"type": "page",
"value": "/pricing"
},
"direction": "next",
"max_depth": 3,
"total_anchor_sessions": 1823,
"branches": [
{
"nodes": ["/signup"],
"sessions": 542,
"share": 29.7
},
{
"nodes": ["/features"],
"sessions": 389,
"share": 21.3
},
{
"nodes": ["/signup", "/onboarding"],
"sessions": 321,
"share": 17.6
},
{
"nodes": ["/"],
"sessions": 234,
"share": 12.8
},
{
"nodes": ["/features", "/signup"],
"sessions": 198,
"share": 10.9
},
{
"nodes": ["/signup", "/onboarding", "/dashboard"],
"sessions": 176,
"share": 9.7
},
{
"nodes": ["/docs"],
"sessions": 142,
"share": 7.8
}
]
}
}
curl -X GET "https://analytics.example.com/api/websites/abc123/journey?anchor_type=event&anchor_value=signup_completed&direction=previous&max_depth=2&start_date=2024-03-01&end_date=2024-03-07" \
-H "Authorization: Bearer spk_live_your_api_key"
{
"data": {
"anchor": {
"type": "event",
"value": "signup_completed"
},
"direction": "previous",
"max_depth": 2,
"total_anchor_sessions": 618,
"branches": [
{
"nodes": ["/pricing"],
"sessions": 287,
"share": 46.4
},
{
"nodes": ["/", "/pricing"],
"sessions": 198,
"share": 32.0
},
{
"nodes": ["/features"],
"sessions": 89,
"share": 14.4
},
{
"nodes": ["/blog/getting-started", "/pricing"],
"sessions": 44,
"share": 7.1
}
]
}
}
nodes array represents the sequence of pages/events in the journeydirection=next, nodes show what happens after the anchordirection=previous, nodes show what happens before the anchorshare percentage shows what portion of sessions that included the anchor followed each path