get_qr_analytics
Analyze QR code performance by tracking scan metrics, trends, device breakdowns, geographic data, and recent scan events to measure engagement.
Instructions
Get enriched scan analytics for a QR code. Returns total scans, daily trends, device/browser/country/referer breakdowns with percentages, and recent scan events with parsed user-agent and geo data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_id | Yes | The short ID of the QR code to get analytics for. | |
| period | No | Time period for aggregations. Default: 30d. | 30d |
Implementation Reference
- packages/mcp/src/tools.ts:193-206 (handler)Definition and handler implementation of the 'get_qr_analytics' tool.
get_qr_analytics: { description: "Get enriched scan analytics for a QR code. Returns total scans, daily trends, device/browser/country/referer breakdowns with percentages, and recent scan events with parsed user-agent and geo data.", inputSchema: z.object({ short_id: z.string().describe("The short ID of the QR code to get analytics for."), period: z .enum(["7d", "30d", "90d", "all"]) .default("30d") .describe("Time period for aggregations. Default: 30d."), }), handler: async (input: { short_id: string; period: string }) => { return apiRequest(`/api/analytics/${input.short_id}`, { query: { period: input.period } }); }, },