User Journeys
rybbit_get_journeysAnalyze website user navigation paths to identify common page sequences and session flow patterns for optimization insights.
Instructions
Get user journey (flow) analysis showing the most common navigation paths through the site. Shows sequences of pages users visit and how many sessions follow each path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| startDate | No | Start date (YYYY-MM-DD) | |
| endDate | No | End date (YYYY-MM-DD) | |
| timeZone | No | IANA timezone (default UTC) | |
| filters | No | Filters to apply | |
| pastMinutesStart | No | Minutes ago start | |
| pastMinutesEnd | No | Minutes ago end | |
| steps | No | Number of journey steps to analyze (default 3) | |
| journeyLimit | No | Max number of journey paths to return (default 100) |
Implementation Reference
- src/tools/journeys.ts:17-107 (registration)The tool "rybbit_get_journeys" is registered here with its schema and handler function.
server.registerTool( "rybbit_get_journeys", { title: "User Journeys", description: "Get user journey (flow) analysis showing the most common navigation paths through the site. Shows sequences of pages users visit and how many sessions follow each path.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { siteId: siteIdSchema, startDate: z .string() .optional() .describe("Start date (YYYY-MM-DD)"), endDate: z .string() .optional() .describe("End date (YYYY-MM-DD)"), timeZone: z .string() .optional() .describe("IANA timezone (default UTC)"), filters: z .array(filterSchema) .optional() .describe("Filters to apply"), pastMinutesStart: z .number() .optional() .describe("Minutes ago start"), pastMinutesEnd: z .number() .optional() .describe("Minutes ago end"), steps: z .number() .int() .min(2) .max(10) .optional() .describe("Number of journey steps to analyze (default 3)"), journeyLimit: z .number() .int() .optional() .describe("Max number of journey paths to return (default 100)"), }, }, async (args) => { try { const { siteId, steps, journeyLimit, ...rest } = args as { siteId: string; steps?: number; journeyLimit?: number; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if (steps !== undefined) params.steps = steps; if (journeyLimit !== undefined) params.limit = journeyLimit; const data = await client.get<JourneyPath[]>( `/sites/${siteId}/journeys`, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true, }; } } ); - src/tools/journeys.ts:69-106 (handler)The handler function for "rybbit_get_journeys" which processes the arguments and calls the Rybbit API.
async (args) => { try { const { siteId, steps, journeyLimit, ...rest } = args as { siteId: string; steps?: number; journeyLimit?: number; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); if (steps !== undefined) params.steps = steps; if (journeyLimit !== undefined) params.limit = journeyLimit; const data = await client.get<JourneyPath[]>( `/sites/${siteId}/journeys`, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true, }; } }