> ## Documentation Index
> Fetch the complete documentation index at: https://docs.queryful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketing performance

> Sessions, sales and ad spend credited to the last click that wasn't direct, by marketing channel, campaign and autopilot activity.

Sessions, sales and ad spend credited to the last click that wasn't direct, by marketing channel, campaign and autopilot activity.

## Example

```sql theme={null}
FROM marketing_performance
  SHOW total_sales, sessions
  GROUP BY marketing_channel
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY total_sales DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `total_sales` | Currency | Sales credited to the last click that wasn't a direct visit. |
| `sessions` | Number | Visits credited to the channel. |
| `orders` | Number | Orders credited to the channel. |
| `average_order_value` | Currency | The credited orders' average value. |
| `new_customers` | Number | First-time customers credited to the channel, counted per day. |
| `returning_customers` | Number | Returning customers credited to the channel, counted per day. |
| `engagements_ad_spend` | Currency | What the channel reports spending. |
| `engagements_impressions` | Number | Times the channel reports showing the ads. |
| `engagements_clicks` | Number | Ad clicks the channel reports. |
| `engagements_orders` | Number | Orders the channel reports from its ads. |

## Dimensions

| Dimension | Description |
| - | - |
| `marketing_channel` | The channel credited, such as google\_ads or klaviyo. |
| `traffic_type` | Paid, organic or direct. |
| `marketing_campaign` | The campaign credited. |
| `marketing_delivery_channel` | Where a Shopify Marketing autopilot activity ran. |
| `marketing_activity_title` | The Shopify Marketing autopilot activity. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `marketing_delivery_channel` | Text | Where a Shopify Marketing autopilot activity ran. |
| `marketing_activity_title` | Text | The Shopify Marketing autopilot activity. |
| `marketing_channel` | Text | The channel credited. |
| `traffic_type` | Text | Paid, organic or direct. |
| `marketing_campaign` | Text | The campaign credited. |
| `marketing_event_id` | Text | The marketing activity's event. |
| `activation_platform` | Text | Where the activity was set up, such as autopilot. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `shop.name`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Marketing attribution](https://docs.queryful.app/queryfulql/datasets/marketing_attribution.md)
* [Marketing spend](https://docs.queryful.app/queryfulql/datasets/marketing_spend.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.