# Upstack Data - [Documentation (194 pages)](https://docs.upstackdata.com/_llms/documentation.txt): Documentation for Documentation. ## Pixel ### SDK - [Upstack Data Pixel: Event Tracking Overview](https://docs.upstackdata.com/pixel.md): Track customer events, capture identity, and forward data to ad platforms with the Upstack Data JavaScript pixel. Quick setup and full SDK reference. - [How to Install the Upstack Data Tracking Pixel](https://docs.upstackdata.com/pixel/setup.md): Install the Upstack Data pixel on any website. Covers installation, verification, common tracking patterns, and identity capture. - [Upstack Data JavaScript SDK Reference](https://docs.upstackdata.com/pixel/javascript-sdk.md): Complete API reference for the Upstack Data JavaScript SDK. Covers all 6 queue commands, 2 direct client methods, TypeScript support, and usage patterns. ### IDENTITY - [Understanding Identity Resolution](https://docs.upstackdata.com/pixel/identity-resolution.md): Upstack ID stitches anonymous sessions into unified customer profiles via deterministic and probabilistic matching — improving CAPI match quality. - [How Session Stitching Works](https://docs.upstackdata.com/pixel/identity-stitching.md): How Upstack ID attaches resolved identity to events, stitches anonymous sessions retroactively, and improves destination match quality. - [Upstack Data Glossary: Key Terms Explained](https://docs.upstackdata.com/pixel/glossary.md): Glossary of Upstack Data terminology — attribution, CAPI, EMQ, identity resolution, destinations, server-side tracking, and other key concepts explained. ### AUTOMATIC TRACKING - [Shopify Automatic Event Tracking](https://docs.upstackdata.com/sources/catalog/shopify-automatic-tracking.md): How Upstack Data automatically captures all customer journey events from your Shopify store — page views, add to cart, checkout, and purchases with no config. - [Automatic Form Capture](https://docs.upstackdata.com/guides/integrations/form-capture-integrations.md): Automatic lead capture from Klaviyo, Postscript, Attentive, Omnisend, Sendlane, Recart, Listrak, Justuno, Alia, Octane AI, and Loop Subscriptions. Upstack Data detects form submissions and fires Lead events automatically. - [Event Tracking (116 pages)](https://docs.upstackdata.com/_llms/event-tracking.txt): Documentation for Event Tracking. - [Metrics (889 pages)](https://docs.upstackdata.com/_llms/metrics.txt): Documentation for Metrics. ## API ### OVERVIEW - [Introduction](https://docs.upstackdata.com/api-reference/introduction.md): Programmatic access to your Upstack Data pixel — authentication, base URLs, scopes, and a curl quickstart. - [Errors](https://docs.upstackdata.com/api-reference/errors.md): Error response format, status code reference, and how to handle failures from the Upstack Data API. - [Rate limiting](https://docs.upstackdata.com/api-reference/rate-limiting.md): How to handle 429 responses from the Upstack Data API. ### ACCOUNT - [Get account details, owners, and subscription plan](https://docs.upstackdata.com/api-reference/account/get-the-account.md): Get the display name, creation date, active owners and admins, and subscription plan of the Upstack account that owns your API key. - [Rename the account](https://docs.upstackdata.com/api-reference/account/rename-the-account.md): Rename the account that owns this API key. Single-field strict allowlist — `accountName` is the only accepted field; any other key in the body is rejected with 400. - [Get order settings and order exclusion filters](https://docs.upstackdata.com/api-reference/account/get-order-settings.md): Read the account's order settings, which decide whether pending and voided orders count, which date refunds land on, and which orders are excluded from reporting. - [Replace order settings and order exclusion filters](https://docs.upstackdata.com/api-reference/account/replace-order-settings.md): Replace the account's order settings in one call, covering pending and voided orders, refund dating, and the complete list of order exclusion filters. ### CATALOG - [List available measures](https://docs.upstackdata.com/api-reference/catalog/list-available-measures.md): Return the catalog of measures available to your pixel — the same list the in-app query builder shows. Use this to discover canonical measure ids before constructing a query or building a dashboard. - [List filter fields for analytics queries](https://docs.upstackdata.com/api-reference/catalog/list-filter-fields.md): List every field you can filter analytics queries by, with its value type, the operators it accepts, and the query endpoints that support it. ### ANALYTICS - [Run an analytics query with measures and dimensions](https://docs.upstackdata.com/api-reference/analytics/run-an-analytics-query.md): Query revenue, orders, ad spend, ROAS, and any other measure for a date range, as a daily, weekly, or monthly series or broken down by up to five dimensions. - [Run an attribution query by UTM source, campaign, or ad](https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query.md): See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row. - [Run a cohort analysis for customer LTV and retention](https://docs.upstackdata.com/api-reference/analytics/run-a-cohort-analysis.md): Group customers by the week, month, or year of their first order and track cumulative revenue per customer, retention, AOV, and contribution margin over time. - [List channel entities with optional metrics](https://docs.upstackdata.com/api-reference/analytics/list-channel-entities-with-optional-metrics.md): List ad accounts, campaigns, ad sets, or ads from the ads-platform integrations connected to your pixel, with optional metric aggregation over a date range. - [List ads with daily spend and performance metrics](https://docs.upstackdata.com/api-reference/analytics/list-ads-with-optional-daily-metrics.md): List every ad from your connected Meta, Google, and TikTok accounts as one flat row per ad, with its campaign and ad set, status, and an optional daily spend or performance series. ### DASHBOARDS - [List dashboard views for a pixel](https://docs.upstackdata.com/api-reference/dashboards/list-dashboard-views.md): List the id, name, and sort order of every dashboard view on your pixel for one dashboard type, so you can find a view before reading, copying, or editing it. - [Get a dashboard view and its widget configuration](https://docs.upstackdata.com/api-reference/dashboards/get-a-dashboard-view.md): Fetch one dashboard view with its full configuration, including sections, widget layout, measures, and the saved date range and attribution settings. - [Create a dashboard view from a full configuration](https://docs.upstackdata.com/api-reference/dashboards/create-a-dashboard-view.md): Create a dashboard view from a complete configuration, with attribution and date defaults, sections, and widgets placed at exact grid positions. - [Build a dashboard from a list of measures](https://docs.upstackdata.com/api-reference/dashboards/build-a-dashboard-from-a-measure-list-preset.md): Create a dashboard from a list of measure ids. The server lays out KPI sparkline tiles four per row and fills in attribution, granularity, and date range defaults. - [Duplicate a dashboard view](https://docs.upstackdata.com/api-reference/dashboards/duplicate-a-dashboard-view.md): Copy a dashboard view into a new view with the same name, dashboard type, sort order, and configuration, so you can change the copy without touching the original. - [Update a dashboard view](https://docs.upstackdata.com/api-reference/dashboards/update-a-dashboard-view.md): Partial update — only fields supplied in the body are changed. Pass at least one of `name`, `configuration`, or `order`. Other fields are rejected by the schema. - [Delete a dashboard view](https://docs.upstackdata.com/api-reference/dashboards/delete-a-dashboard-view.md): **Required scope:** `dashboards:write`. ### COSTS - [Get cost configuration for COGS, shipping, and fees](https://docs.upstackdata.com/api-reference/costs/get-cost-configuration.md): Read cost settings for product defaults, order fees, payment processing fees, shipping, variable costs, and recurring expenses, all at once or one type at a time. - [Update the global product override](https://docs.upstackdata.com/api-reference/costs/update-the-global-product-override.md): Update the default COGS / handling fee applied to product variants that have no per-variant COG line. At least one of `defaultCogs`, `globalHandlingFee`, or `currency` must be supplied. - [Update shipping cost settings](https://docs.upstackdata.com/api-reference/costs/update-shipping-cost-settings.md): Switch the shipping cost attribution method. Pass `fixedRateAmount` when switching to `fixed_rate`; it is not validated as required, and without it no fixed charge applies. - [Add a cost line](https://docs.upstackdata.com/api-reference/costs/add-a-cost-line.md): Add a new cost line for one of the five line-typed cost surfaces — `order`, `gateway`, `shipping` (profile rule), `variable`, or `fixed`. The server assigns a ULID for the new line. - [Update an order, payment, shipping, or recurring cost line](https://docs.upstackdata.com/api-reference/costs/update-a-cost-line.md): Change fields on an order fee, payment fee, shipping profile, variable cost, or recurring expense line by id. Fields you don't send keep their values. - [Delete a cost line](https://docs.upstackdata.com/api-reference/costs/delete-a-cost-line.md): Remove a cost line from the named cost config by its ULID. Triggers a per-order COGS recalculation downstream — the deleted line is passed to the recalc trigger so affected orders can be identified. ### PRODUCTS - [Search products](https://docs.upstackdata.com/api-reference/products/search-products.md): Search products by title / SKU / variant. Cursor-paginated. - [Get a product variant](https://docs.upstackdata.com/api-reference/products/get-a-product-variant.md): Returns one variant in full — identity, its parent product's details, current price, handling fee, and both cost histories. - [Set a variant's handling fee](https://docs.upstackdata.com/api-reference/products/set-a-variants-handling-fee.md): Set the per-variant handling fee. Triggers a per-order COGS recalculation downstream. - [Add a COGS line to a product variant](https://docs.upstackdata.com/api-reference/products/add-a-cog-line-to-a-variant.md): Add a dated per-unit cost (COGS) to a product variant, such as a new supplier price from a given date. Upstack recalculates the past orders the line covers. - [Update a COGS line on a product variant](https://docs.upstackdata.com/api-reference/products/update-a-cog-line.md): Change the cost, effective dates, or note on one of a product variant's manual COG lines. Only the fields you send are changed; the rest keep their stored values. - [Delete a COGS line from a product variant](https://docs.upstackdata.com/api-reference/products/delete-a-cog-line.md): Remove one manual COG line from a product variant. Orders it covered fall back to another matching line, the Shopify cost, or the Default COGS percentage. ### EVENTS - [Send events via Upstack Conversion API](https://docs.upstackdata.com/api-reference/events/send-events-via-upstack-conversion-api.md): **Upstack Conversion API (CAPI)** — send tracking events from your server. They join the same pipeline as browser pixel events: identity resolution, enrichment, analytics, and destination forwarding. ## CLI ### GETTING STARTED - [Install the Upstack CLI](https://docs.upstackdata.com/cli/install.md): Install the upstack CLI and configure it with an API key and pixel id. - [AI agent workflow](https://docs.upstackdata.com/cli/ai-agent-workflow.md): Use Claude (or another agent) in your terminal to translate natural-language intent into structured upstack CLI calls. ### ACCOUNT - [upstack account](https://docs.upstackdata.com/cli/account.md): Read and rename the Upstack account that owns the configured API key — wraps the public /api/account endpoints. ### DISCOVERY - [upstack measures](https://docs.upstackdata.com/cli/measures.md): List the measures catalog from the command line. Find canonical measure ids before building a query or dashboard. - [upstack dimensions](https://docs.upstackdata.com/cli/dimensions.md): List the dimensions available for grouping and filtering queries. Bundled with the CLI — no network call. - [upstack filters](https://docs.upstackdata.com/cli/filters.md): List the filter-fields catalog from the command line. Find canonical filter field ids, value types, operators, and applicable contexts before constructing a --filter. ### QUERIES - [upstack query](https://docs.upstackdata.com/cli/query.md): Run a measures-and-dimensions query from the command line. Wraps POST /api/query. - [upstack query-attribution](https://docs.upstackdata.com/cli/query-attribution.md): Credit orders or events to UTM sources, campaigns, ad sets, and ads from the CLI. Filter by campaign name or platform ID, then export new customers and ROAS. - [upstack query-cohort](https://docs.upstackdata.com/cli/query-cohort.md): Run a cohort analysis from the command line. Wraps POST /api/query-cohort-analysis. - [upstack query-channel-details](https://docs.upstackdata.com/cli/query-channel-details.md): List ad accounts, campaigns, ad sets, or ads with optional metrics from the command line. Wraps POST /api/query-channel-details. - [upstack query-ads](https://docs.upstackdata.com/cli/query-ads.md): List every Meta, Google, and TikTok ad from the CLI as one flat row per ad, with campaign, ad set, status, and optional daily spend with a compare period. ### DASHBOARDS - [upstack dashboard view](https://docs.upstackdata.com/cli/dashboard-view.md): Manage Upstack dashboard views from the command line — list, show, create, update, copy, delete, organize widgets into sections, pin KPIs, and the high-level preset builder. ### COSTS - [upstack costs](https://docs.upstackdata.com/cli/costs.md): Read and update cost configuration from the CLI — global overrides, shipping method, and per-type cost lines (order / gateway / shipping / variable / fixed). ### PRODUCTS - [upstack products](https://docs.upstackdata.com/cli/products.md): Browse products and manage per-variant costs — handling fee + COGS history — from the CLI. ### ADVANCED - [upstack saved](https://docs.upstackdata.com/cli/saved-queries.md): Cache query parameters locally for reuse. Run, list, inspect, and delete saved queries. - [upstack history](https://docs.upstackdata.com/cli/history.md): Inspect or re-run previously executed queries. Every query run is logged locally. - [Profiles](https://docs.upstackdata.com/cli/profiles.md): Switch between API keys, pixels, and environments using named profiles. - [Configuration defaults](https://docs.upstackdata.com/cli/config-defaults.md): Set per-profile defaults so you don't repeat common flags on every query. ## OpenAPI Specs - [openapi](/api-reference/openapi.yaml) > The links below point to documentation indexes. Follow each `/_llms/` index recursively until you reach documentation pages. ## Indexes - [Documentation (194 pages)](https://docs.upstackdata.com/_llms/documentation.txt): Documentation for Documentation. - [Event Tracking (116 pages)](https://docs.upstackdata.com/_llms/event-tracking.txt): Documentation for Event Tracking. - [Metrics (889 pages)](https://docs.upstackdata.com/_llms/metrics.txt): Documentation for Metrics. - [Metrics / METRICS (889 pages)](https://docs.upstackdata.com/_llms/metrics/metrics.txt): Documentation for Metrics / METRICS. - [Metrics / METRICS / Advertising (334 pages)](https://docs.upstackdata.com/_llms/metrics/metrics/advertising.txt): Documentation for Metrics / METRICS / Advertising. - [Metrics / METRICS / Orders (284 pages)](https://docs.upstackdata.com/_llms/metrics/metrics/orders.txt): Documentation for Metrics / METRICS / Orders. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.