TanqoryDocs

tanqoryExtMarketingPerformance

  • Query
  • Discounts and marketing

Sales attributed to marketing over a range of days (inclusive, in the store's time zone), read from the store's orders: an order is marketing traffic when its landing URL carries UTM parameters or it has a referring site other than the store (last non-direct click). compareFrom / compareTo add the previous period. campaignId limits every figure to the traffic of one campaign. traffic (default MARKETING) picks which traffic is attributed: ALL adds direct traffic (as the channel "Direct"), PAID / ORGANIC keep one type. attributionModel (default LAST_NON_DIRECT_CLICK): an order records one visit (its landing URL and referrer), so every model credits that visit; LAST_CLICK and ANY_CLICK also credit direct visits. Sessions are not tracked: the session fields are null.

Arguments

ArgumentTypeRequiredDefault
attributionModelTanqoryExtAttributionModelOptional
campaignIdIDOptional
compareFromDateOptional
compareToDateOptional
fromDate!Required
toDate!Required
trafficTanqoryExtMarketingTrafficOptional

Returns

TanqoryExtMarketingPerformance!

FieldTypeDescription
attributedOrdersInt!
attributedSalesDecimal!

Sales of the orders attributed to marketing (or to the campaign).

averageOrderValueDecimal

attributedSales / attributedOrders, null without orders.

campaigns[TanqoryExtMarketingCampaignRow!]!

Attributed traffic grouped by campaign (utm_campaign, or the store's campaign it matches).

channels[TanqoryExtMarketingChannelRow!]!

Attributed traffic grouped by channel (utm_source or referring domain), largest sales first.

compareDays[TanqoryExtMarketingDay!]
currencyCodeCurrencyCode!
days[TanqoryExtMarketingDay!]!

One point per day of the range (and of the comparison range, when asked).

newCustomerOrdersInt!
ordersInt!
returningCustomerOrdersInt!
sessionsInt

Sessions are not tracked by this server yet: always null.

totalSalesDecimal!

Sales of all orders in the range (the store's total sales).

utm[TanqoryExtMarketingUtmRow!]!

Attributed traffic grouped by UTM source / medium / campaign.

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"query TanqoryExtMarketingPerformance($from: Date!, $to: Date!) {\n  tanqoryExtMarketingPerformance(from: $from, to: $to) {\n    attributedOrders\n    attributedSales\n    averageOrderValue\n    currencyCode\n    newCustomerOrders\n    orders\n    returningCustomerOrders\n    sessions\n    totalSales\n  }\n}","variables":{"from":"","to":""}}'

Built from commit c0b3fb3fdef7 · API version 2026-10