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

# Product Breakdowns

> Extract product-level context stored in the conversions dataset to support product-level performance and revenue analysis.

# Description

Product information can be captured in the Rockerbox **Conversions dataset** within the `additional_attributes` column. This field stores supplemental conversion metadata in **JSON format**, including product-level details passed during the conversion event.

To analyze product-level performance in your warehouse, you must extract the `products` field from the JSON structure using the appropriate JSON parsing functions supported by your data warehouse.

Conversions with product context can then be joined against attribution data in the log level MTA schema using the `date` and `conversion_key`

***

# When to Use This Analysis

* Analyze **product-level performance** from conversion events tracked by Rockerbox.
* Extract product metadata captured during the conversion event.
* Support reporting that breaks out **revenue and conversions by product**.
* Build downstream product-level reporting or join conversion data with product catalogs.

***

# Source Data

This analysis uses fields from the **Conversions dataset**.

| Field                            | Description                                                                   |
| -------------------------------- | ----------------------------------------------------------------------------- |
| `conversion_id`                  | Unique identifier for each conversion event                                   |
| `date`                           | Date the conversion occurred                                                  |
| `additional_attributes`          | JSON column containing additional metadata captured with the conversion event |
| `additional_attributes.products` | JSON field containing product information passed with the conversion          |

The `products` field must be extracted from the JSON structure before it can be used in reporting.

***

# Key Metrics

| Metric     | SQL Logic            | Description                                              |
| ---------- | -------------------- | -------------------------------------------------------- |
| `products` | Extracted JSON field | Product information associated with the conversion event |

Note: Product-level revenue allocation may require additional SQL processing if multiple products are associated with a single order.

***

# Example Queries

## Snowflake

Extract the `products` field from the JSON column.

```sql theme={null}
SELECT
    *,
    additional_attributes:products::varchar AS products
FROM conversions_table;
```

## Redshift

Use the JSON extraction function to retrieve the product field.

```sql theme={null}
SELECT
    *,
    json_extract_path_text(additional_attributes, 'products')::varchar AS products
FROM conversions_table;
```

## BigQuery

Use JSON functions to extract the product field.

```sql theme={null}
SELECT
    *,
    JSON_EXTRACT_SCALAR(additional_attributes, '$.products') AS products
FROM conversions_table;
```
