record_conversion
Track QR code ROI by recording post-scan conversions like purchases or signups with optional monetary values for performance analysis.
Instructions
Record a post-scan conversion event (purchase, signup, etc.) for a QR code you own. Use this to track ROI — e.g., when a user scans a QR code and then makes a purchase, record a 'purchase' conversion with the order value. For client-side tracking without code, use the tracking pixel: .
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_id | Yes | The short_id of the QR code this conversion is for. | |
| event | Yes | The conversion event name (e.g., "purchase", "signup", "add_to_cart"). Use consistent names to aggregate stats. | |
| value | No | Optional monetary value of the conversion (e.g., 49.99). | |
| metadata | No | Optional JSON metadata (e.g., product ID, order number). |
Implementation Reference
- packages/mcp/src/tools.ts:844-867 (handler)The record_conversion MCP tool definition, which uses the apiRequest helper to POST data to the /api/conversions endpoint.
record_conversion: { description: "Record a post-scan conversion event (purchase, signup, etc.) for a QR code you own. Use this to track ROI — e.g., when a user scans a QR code and then makes a purchase, record a 'purchase' conversion with the order value. For client-side tracking without code, use the tracking pixel: <img src=\"https://yourhost/t/{short_id}?event=purchase&value=49.99\">.", inputSchema: z.object({ short_id: z.string().describe("The short_id of the QR code this conversion is for."), event: z .string() .max(100) .describe( 'The conversion event name (e.g., "purchase", "signup", "add_to_cart"). Use consistent names to aggregate stats.' ), value: z .number() .optional() .describe("Optional monetary value of the conversion (e.g., 49.99)."), metadata: z .record(z.string(), z.unknown()) .optional() .describe("Optional JSON metadata (e.g., product ID, order number)."), }), handler: async (input: Record<string, unknown>) => { return apiRequest("/api/conversions", { method: "POST", body: input }); }, },