> ## 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 attribution

> Sales and orders credited to marketing campaigns under each attribution model.

Sales and orders credited to marketing campaigns under each attribution model.

## Example

```sql theme={null}
FROM marketing_attribution
  SHOW campaign_last_click_sales, campaign_last_click_order_count
  GROUP BY utm_campaign
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY campaign_last_click_sales DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `campaign_last_click_sales` | Currency | Sales credited to the campaign of the last click before the order. |
| `campaign_last_click_order_count` | Number | Orders credited to the campaign of the last click. |
| `campaign_first_click_sales` | Currency | Sales credited to the campaign of the first click. |
| `campaign_last_non_direct_click_sales` | Currency | Sales credited to the last campaign click that wasn't a direct visit. |
| `campaign_linear_sales` | Currency | Sales shared equally across every campaign click before the order. |

## Dimensions

| Dimension | Description |
| - | - |
| `utm_campaign` | The campaign's utm\_campaign. |
| `referring_channel` | The channel the campaign ran on. |
| `campaign_id` | Shopify's id for the campaign. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `utm_campaign` | Text | The campaign's utm\_campaign. |
| `referring_channel` | Text | The channel the campaign ran on. |
| `campaign_id` | Text | Shopify's id for the campaign. |

## 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 spend](https://docs.queryful.app/queryfulql/datasets/marketing_spend.md)
* [Marketing performance](https://docs.queryful.app/queryfulql/datasets/marketing_performance.md)


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