Trends
Trend one event type's volume over time
cdp_trends
Trends the volume of one event type over time for your brand — a date-histogram of event counts read across both CDP substrates and merged: the OpenSearch pixel store (browse events like product_viewed) and the Aurora server-side store (server-side interaction events, dot-named types like order.placed, subscription.charged). Pass an event_type and an interval, and optionally bound the window with from/to. A legacy name that returns no rows is retried once under its unambiguous canonical name (aliasedTo is set, e.g. order_created → order.placed); an ambiguous or unknown empty type returns an availableTypes hint of the top ingested types. Not sure which event types exist? Call cdp_list_event_types.
Read-only and scoped to your brand.
Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
event_type | string | Yes | The event type to trend, e.g. product_viewed. | — |
interval | string | No | Date-histogram bucket interval: 1d, 1w, 1M, 30m, and so on. | 1d |
from | string | No | ISO-8601 window lower bound (inclusive), e.g. 2026-06-01. | — |
to | string | No | ISO-8601 window upper bound (inclusive), e.g. 2026-06-30. | — |
format | string | No | Bucket-key date format, e.g. yyyy-MM-dd. Omit for raw epoch-ms keys. | — |
Returns
eventType,interval,property(timeStamp), and thefrom/toyou passed.buckets— an array of{ key, count }, in chronological order (merged across both substrates, summed per key).totals—{ all, filtered, missing }accounting totals (from the OpenSearch read).scope— your brand's shop domain.basis— which substrate(s) served the data:"opensearch","aurora","merged", or"empty".sources— the substrates that contributed buckets, a subset of["opensearch", "aurora"].aliasedTo— present only when the requested type had no rows and an unambiguous canonical alias was served instead (e.g."order.placed").availableTypes— present only on an empty/ambiguous result: an array of{ eventType, count }, the top ingested types by volume, to retry with.degraded— present only when a substrate browned out:{ opensearch?, aurora? }, the affected substrate(s).note— present when there's something to explain (the basis, an alias, or degradation); a short human-readable summary.
Example prompts
Trend product_viewed by day for the last 14 daysShow me checkout_started volume per week since June 1stNotes
- The brand scope is injected server-side, so counts only ever cover your own events.
- Each event type lives in exactly one substrate, so a series is normally disjoint;
basis/sourcesrecord which substrate(s) served it. A degraded substrate is labeled indegradedand never fabricates an empty series — a hard OpenSearch brown-out with no Aurora fallback surfaces a clear error instead. - Pass a
formatfor readable bucket keys (e.g.yyyy-MM-dd); omit it for raw epoch-millisecond keys. - Aggregate queries are throttled — on a rate limit, the tool returns a clear rate-limit error rather than a partial result.