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

# Collections dataset

> LayersQL Collections dataset reference for analyzing browse traffic, page views, conversion rates, and revenue across your store's collection pages.

* **Label:** Collections
* **Description:** Analytics for collection browsing and conversions.
* **Default group key:** `collection_handle`

## Metrics

* **requests (requests)**
  * Number of collection browse requests.
  * Example: COUNT\_DISTINCT(requests)
* **total\_sales (USD)**
  * Sales attributed to collection browsing.
  * Example: SUM(total\_sales)
* **quantity\_purchased (items)**
  * Number of items purchased from collection browsing.
  * Example: SUM(quantity\_purchased)
* **view\_sessions (sessions)**
  * Sessions where a collection page was viewed.
* **cart\_sessions (sessions)**
  * Sessions where items from a collection browse were added to cart.
* **quantity\_added\_to\_cart (items)**
  * Items added to cart from collection browsing.

## Dimensions

* **collection\_handle:** The collection handle.
* **collection\_title:** Resolved collection title.
* **collection\_id:** Resolved collection ID.
* **sort\_order\_id:** The sort order ID used for the collection.
* **sort\_order:** The sort order applied.
* **rule\_id:** The merchandising rule applied.
* **applied\_filters:** Serialized applied filters on the browse request.
* **shopping\_channel:** The shopping channel (e.g., online\_store).
* **attribution\_token:** Token used to attribute downstream events/purchases.
* **geo\_country:** Two-letter country code.
* **geo\_state:** Up to three-letter province code.
* **geo\_city:** City name as captured.
* **marketing\_source:** UTM source.
* **marketing\_medium:** UTM medium.
* **marketing\_campaign:** UTM campaign.
* **device:** Device category.
* **os:** Operating system.

## Examples

Collection impressions by handle (last 7 days)

```sql theme={null}
FROM collections
SHOW COUNT_DISTINCT(requests)
GROUP BY collection_handle
SINCE -7d
```

Collection revenue by sort order (this month)

```sql theme={null}
FROM collections
SHOW SUM(total_sales)
GROUP BY sort_order_id
SINCE this_month
```

Collection performance by merchandising rule

```sql theme={null}
FROM collections
SHOW COUNT_DISTINCT(requests), SUM(total_sales)
GROUP BY rule_id
SINCE -7d
```

## Next steps

* [LayersQL syntax](/platform/layersql/syntax)
* [LayersQL functions](/platform/layersql/functions)
* [Datasets overview](/platform/layersql/datasets)
