---
title: shop_campaign_insights
description: >-
  Reference for the ShopifyQL `shop_campaign_insights` schema. Every metric and
  dimension, paired with worked example queries.
api_version: 2026-10
source_url:
  html: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/shop_campaign_insights
  md: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/shop_campaign_insights.md
api_name: shopifyql
---

# shop\_​campaign\_​insights

The `shop_campaign_insights` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures how your Shop Campaigns perform. It brings campaign sales, ad spend, and customer results together in one dataset, keyed by campaign.

### Use cases

* **Sales vs. spend**: Group [`shop_campaign_sales`](#shopcampaigninsightsmetric-propertydetail-shopcampaignsales) and [`shop_campaign_ad_spend`](#shopcampaigninsightsmetric-propertydetail-shopcampaignadspend) by [`shop_campaign_name`](#shopcampaigninsightsdimension-propertydetail-shopcampaignname) to see which campaigns return more than they cost.
* **Efficiency**: Show [`shop_campaign_return_on_ad_spend`](#shopcampaigninsightsmetric-propertydetail-shopcampaignreturnonadspend) with [`shop_campaign_average_customer_acquisition_cost`](#shopcampaigninsightsmetric-propertydetail-shopcampaignaveragecustomeracquisitioncost) to see which campaigns bring customers in profitably.
* **Customer trend**: Trend [`shop_campaign_customers`](#shopcampaigninsightsmetric-propertydetail-shopcampaigncustomers) by month to see how many customers campaigns bring in over time.

Examples

### Examples

* ####

  ##### Description

  Rank the top 50 Shop Campaigns this quarter by \`shop\_campaign\_sales\`, with ad spend and ROAS. This example uses \[\`WITH PERCENT\_CHANGE\`]\(/docs/api/shopifyql/latest/syntax/with#percent-change-columns) for the change column, with \[\`COMPARE TO previous\_quarter\`]\(/docs/api/shopifyql/latest/syntax/compare-to) benchmarking each campaign against last quarter.

  ##### ShopifyQL

  ```shopifyql
  FROM shop_campaign_insights
    SHOW shop_campaign_sales, shop_campaign_ad_spend,
      shop_campaign_return_on_ad_spend,
      shop_campaign_average_customer_acquisition_cost
    GROUP BY shop_campaign_name WITH PERCENT_CHANGE
    DURING this_quarter
    COMPARE TO previous_quarter
    ORDER BY shop_campaign_sales DESC
    LIMIT 50
  VISUALIZE shop_campaign_sales TYPE horizontal_bar
  ```

* ####

  ##### Description

  Track weekly \`shop\_campaign\_ad\_spend\` for the five highest-spending Shop Campaigns this quarter. This example uses \[\`GROUP BY TOP 5\`]\(/docs/api/shopifyql/latest/syntax/group-by) to roll the rest into one remainder line.

  ##### ShopifyQL

  ```shopifyql
  FROM shop_campaign_insights
    SHOW shop_campaign_ad_spend, shop_campaign_return_on_ad_spend
    GROUP BY TOP 5 shop_campaign_name WITH GROUP_TOTALS
    TIMESERIES week
    DURING this_quarter
    ORDER BY week ASC
  VISUALIZE shop_campaign_ad_spend TYPE line
  ```

* ####

  ##### Description

  Track weekly \`shop\_campaign\_customers\` from Shop Campaigns across this quarter, with \`shop\_campaign\_average\_order\_value\`. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add a quarter-to-date column beside the weekly rows.

  ##### ShopifyQL

  ```shopifyql
  FROM shop_campaign_insights
    SHOW shop_campaign_customers, shop_campaign_average_order_value,
      shop_campaign_insights_last_updated_at
    TIMESERIES week WITH TOTALS
    DURING this_quarter
    ORDER BY week ASC
  VISUALIZE shop_campaign_customers TYPE line
  ```

* ####

  ##### Description

  Compare monthly \`shop\_campaign\_ad\_spend\` this year against last year. This example uses \[\`COMPARE TO previous\_year\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to set last year as the year-over-year baseline.

  ##### ShopifyQL

  ```shopifyql
  FROM shop_campaign_insights
    SHOW shop_campaign_ad_spend
    TIMESERIES month WITH PERCENT_CHANGE
    DURING this_year
    COMPARE TO previous_year
    ORDER BY month ASC
  VISUALIZE shop_campaign_ad_spend TYPE bar
  ```

***

## Metrics

Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying `FROM shop_campaign_insights`.

* **shop\_​campaign\_​ad\_​spend**

  **MONEY**

  The total ad spend tied to orders associated with Shop Campaigns, in your store's currency.

* **shop\_​campaign\_​average\_​customer\_​acquisition\_​cost**

  **MONEY**

  Average customer acquisition cost is reported in your store's currency and is based on customers attributed to Shop Campaigns when their last paid click happened within seven days.

  `Average customer acquisition cost = shop campaign ad spend / shop campaign customers`

* **shop\_​campaign\_​average\_​order\_​value**

  **MONEY**

  The average value of orders associated with Shop Campaigns, in your store's currency.

  `Shop Campaign average order value = shop campaign sales / shop campaign customers`

* **shop\_​campaign\_​customers**

  **INTEGER**

  Number of customers that placed orders associated with Shop Campaigns

* **shop\_​campaign\_​orders**

  **INTEGER**

  Number of orders associated with Shop Campaigns

* **shop\_​campaign\_​return\_​on\_​ad\_​spend**

  **MULTIPLIER**

  A value of 3 means orders associated with Shop Campaigns produced three times the ad spend in sales.

  `Shop Campaign return on ad spend = shop campaign sales / shop campaign ad spend`

* **shop\_​campaign\_​sales**

  **MONEY**

  Sales revenue from orders associated with Shop Campaigns, after discounts and including taxes and shipping, in your store's currency. Refunds are excluded.

### MONEY

Currency amount such as a price, revenue, cost, or discount

```ts
```

### INTEGER

Whole number without decimal places, used for counts and quantities

```ts
```

### MULTIPLIER

Number multiplied by another value to increase or decrease it

```ts
```

***

## Dimensions

Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.

Dimensions you can use when querying `FROM shop_campaign_insights`.

* **country**

  **STRING**

  Billing country for orders associated with Shop Campaigns

* **country\_​code**

  **STRING**

  The two-letter ISO 3166-1 alpha-2 code for the billing country on orders associated with Shop Campaigns, such as US or CA.

* **day**

  **DAY\_TIMESTAMP**

  Use this to group Shop Campaign orders by the day they happened.

* **day\_​of\_​week**

  **DAY\_OF\_WEEK**

  Use this to group Shop Campaign orders by day of week, with values Monday through Sunday.

* **hour**

  **HOUR\_TIMESTAMP**

  Use this to group Shop Campaign orders by the hour they happened.

* **hour\_​of\_​day**

  **HOUR\_OF\_DAY**

  Use this to group Shop Campaign orders by hour of day, with values 0 through 23.

* **month**

  **MONTH\_TIMESTAMP**

  Use this to group Shop Campaign orders by the month they happened.

* **month\_​of\_​year**

  **MONTH\_OF\_YEAR**

  Use this to group Shop Campaign orders by month of year, with values 1 through 12.

* **quarter**

  **QUARTER\_TIMESTAMP**

  Use this to group Shop Campaign orders by the quarter they happened.

* **shop\_​campaign\_​name**

  **STRING**

  Name of the Shop Campaign

* **shop\_​campaign\_​target\_​name**

  **STRING**

  The customer segment targeted by the Shop Campaign. Values include New customers, All other customers, Lapsed - 3 months, and Lapsed - 12 months.

* **shop\_​id**

  **IDENTITY**

  The unique Shopify identifier for your store. Use [`shop_id`](#shopcampaigninsightsdimension-propertydetail-shopid) with [`shop_name`](#shopcampaigninsightsdimension-propertydetail-shopname) to show readable store labels.

* **week**

  **WEEK\_TIMESTAMP**

  Use this to group Shop Campaign orders by the week they happened.

* **week\_​of\_​year**

  **WEEK\_OF\_YEAR**

  Use this to group Shop Campaign orders by week of year, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  Use this to group Shop Campaign orders by the year they happened.

* **shop\_​name**

  **STRING**

  Name of your store

### STRING

Text made of letters, numbers, or symbols

```ts
```

### DAY\_TIMESTAMP

Date with the time of day removed

```ts
```

### DAY\_OF\_WEEK

Day of the week, used to group or filter data by weekday

```ts
```

### HOUR\_TIMESTAMP

Date and time with minutes and seconds removed

```ts
```

### HOUR\_OF\_DAY

Hour of the day, shown as a whole number from 0 to 23

```ts
```

### MONTH\_TIMESTAMP

Date for the start of a month

```ts
```

### MONTH\_OF\_YEAR

Month number within a year

```ts
```

### QUARTER\_TIMESTAMP

Date for the start of a fiscal quarter

```ts
```

### IDENTITY

Unique identifier for a Shopify resource such as a customer or order

```ts
```

### WEEK\_TIMESTAMP

Date for the start of a week

```ts
```

### WEEK\_OF\_YEAR

Week number within a year

```ts
```

### YEAR\_TIMESTAMP

Date for the start of a year

```ts
```

***

## Related schemas

* [`shop_product_impressions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/shop_product_impressions): Switch to this to see which products got exposure from Shop channel impressions.

***
