get_metrics_comparison
BEST FOR COMPARISONS AND THE CANONICAL CONVERSION RATE: Get core e-commerce metrics (Revenue, Sessions, CVR, AOV, Revenue per Session) with period-over-period comparisons. CVR here uses Shopify TrafficStat sessions (Plus/Advanced) — or GA4 sessions as fallback — divided by REAL Shopify orders. This is the right source for 'what's my conversion rate?' / 'how's my CVR trending?' questions. Do NOT use Triple Whale pixel CVR (from get_connector_data(connector:'triple-whale') or get_marketing_performance._pixelFunnel) as a stand-in: pixel undercounts purchases and sessions and produces misleading absolute numbers. Supports WoW (week-over-week), MoM (month-over-month), YoY (year-over-year), and custom period comparisons. Returns { period, metrics, comparison, charts, presentation }. charts is an array of grouped-bar specs (one per headline metric, current vs comparison) ready to drop into any plotting library. DEFAULT TO RENDERING THE RELEVANT CHART when the user is comparing periods or asks 'how is X vs Y' — bar charts are the natural fit. Use comparison.changes for the % delta caption. Use raw numbers from metrics only when the user asks for a single specific value.
Notes
This is the canonical CVR source. Do not substitute Triple Whale pixel CVR (get_connector_data(connector:'triple-whale') /
_pixelFunnel).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| endDate | Yes | End date of current period (YYYY-MM-DD) | |
| startDate | Yes | Start date of current period (YYYY-MM-DD) | |
| comparison | No | Comparison type: wow (week-over-week), mom (month-over-month), yoy (year-over-year), previous (equivalent previous period) | |
| compareLabel | No | Label for custom comparison period (e.g., 'Last Year Black Friday Sale') | |
| compareEndDate | No | For custom comparison: end date of comparison period (YYYY-MM-DD) | |
| compareStartDate | No | For custom comparison: start date of comparison period (YYYY-MM-DD) |