# Schema

## Overview

These tables support controlled audience and geographic A/B testing within the Bonsai platform. They consolidate test configurations, performance metrics, and statistical lift results to quantify causal impact and determine whether marketing investments drive measurable business improvement.

***

### Performance Stats

<details>

<summary><code>inc_test_daily_stats_table</code> schema<br><br><strong>Description:</strong> The daily performance stats for business and marketing channels included in audience A/B tests measured by the Bonsai platform.</summary>

| field\_name           | is\_nullable | data\_type | definition                                                                                               |
| --------------------- | ------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
| client\_number        | YES          | INT64      | An internal client identifier.                                                                           |
| date                  | YES          | DATE       | The calendar date of the event.                                                                          |
| test\_id              | YES          | INT64      | The ID number for the test in the Bonsai platform.                                                       |
| test\_group           | YES          | STRING     | The test group assignment in the Bonsai platform.                                                        |
| test\_period          | YES          | STRING     | The test period designation in the Bonsai platform.                                                      |
| test\_type            | YES          | STRING     | The type of test.                                                                                        |
| customer\_id          | YES          | STRING     | The ad platform customer ID, where applicable.                                                           |
| dma\_id               | YES          | STRING     | Bonsai's DMA ID.                                                                                         |
| impressions           | YES          | FLOAT64    | Ad impressions.                                                                                          |
| clicks                | YES          | FLOAT64    | Ad clicks.                                                                                               |
| cost                  | YES          | FLOAT64    | Media ad cost.                                                                                           |
| google\_impressions   | YES          | FLOAT64    | Ad impressions from Google Ads.                                                                          |
| google\_clicks        | YES          | FLOAT64    | Ad clicks from Google Ads.                                                                               |
| google\_cost          | YES          | FLOAT64    | Media cost from Google Ads.                                                                              |
| facebook\_impressions | YES          | FLOAT64    | Ad impressions from Meta Ads.                                                                            |
| facebook\_clicks      | YES          | FLOAT64    | Ad clicks from Meta Ads.                                                                                 |
| facebook\_cost        | YES          | FLOAT64    | Media cost from Meta Ads.                                                                                |
| metric1–metric10      | YES          | FLOAT64    | Business-specific metrics (e.g., revenue, page views, conversions) associated with the test measurement. |

</details>

<details>

<summary><code>mmt_table</code> schema<br><br><strong>Description:</strong> Record of Incrementality Tests measured by the Bonsai Platform.</summary>

| field\_name           | is\_nullable | data\_type | definition                                                              |
| --------------------- | ------------ | ---------- | ----------------------------------------------------------------------- |
| client\_number        | YES          | INTEGER    | An internal client identifier.                                          |
| test\_id              | YES          | INTEGER    | The ID number for the test in the Bonsai platform.                      |
| test\_desc            | YES          | STRING     |                                                                         |
| test\_name            | YES          | STRING     |                                                                         |
| test\_hypothesis      | YES          | STRING     |                                                                         |
| methodology           | YES          | STRING     |                                                                         |
| channels              | YES          | STRING     |                                                                         |
| success\_metrics      | YES          | STRING     |                                                                         |
| test\_dma             | YES          | STRING     |                                                                         |
| control\_dma          | YES          | STRING     |                                                                         |
| test\_pre\_date       | YES          | DATE       |                                                                         |
| test\_pre\_end\_date  | YES          | DATE       |                                                                         |
| test\_start\_date     | YES          | DATE       |                                                                         |
| test\_end\_date       | YES          | DATE       |                                                                         |
| iroi\_metric          | YES          | STRING     |                                                                         |
| inc\_vpc\_metric      | YES          | STRING     |                                                                         |
| aud\_ab\_test\_id     | YES          | INTEGER    |                                                                         |
| live\_flag            | YES          | BOOLEAN    | Denotes whether an Incrementality model is live in the Bonsai platform. |
| metric1\_name         | YES          | STRING     |                                                                         |
| metric2\_name         | YES          | STRING     |                                                                         |
| metric3\_name         | YES          | STRING     |                                                                         |
| metric4\_name         | YES          | STRING     |                                                                         |
| metric5\_name         | YES          | STRING     |                                                                         |
| metric6\_name         | YES          | STRING     |                                                                         |
| metric7\_name         | YES          | STRING     |                                                                         |
| metric8\_name         | YES          | STRING     |                                                                         |
| metric9\_name         | YES          | STRING     |                                                                         |
| metric10\_name        | YES          | STRING     |                                                                         |
| metric11\_name        | YES          | STRING     |                                                                         |
| metric12\_name        | YES          | STRING     |                                                                         |
| metric13\_name        | YES          | STRING     |                                                                         |
| metric14\_name        | YES          | STRING     |                                                                         |
| metric15\_name        | YES          | STRING     |                                                                         |
| metric16\_name        | YES          | STRING     |                                                                         |
| metric17\_name        | YES          | STRING     |                                                                         |
| metric18\_name        | YES          | STRING     |                                                                         |
| metric19\_name        | YES          | STRING     |                                                                         |
| metric20\_name        | YES          | STRING     |                                                                         |
| mmt\_metric\_1\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_2\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_3\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_4\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_5\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_6\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_7\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_8\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_9\_type  | YES          | STRING     |                                                                         |
| mmt\_metric\_10\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_11\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_12\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_13\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_14\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_15\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_16\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_17\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_18\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_19\_type | YES          | STRING     |                                                                         |
| mmt\_metric\_20\_type | YES          | STRING     |                                                                         |
| accepted\_flag        | YES          | INTEGER    |                                                                         |
| test\_type            | YES          | STRING     | The type of test.                                                       |

</details>

### Lift Stats

<details>

<summary><code>mmt_difference_significance_python_table</code> schema<br><br><strong>Description:</strong> The lift statistics measured, by test, in the Bonsai platform.</summary>

| field\_name    | is\_nullable | data\_type | definition                                                         |
| -------------- | ------------ | ---------- | ------------------------------------------------------------------ |
| client\_number | YES          | INT64      | An internal client identifier.                                     |
| test\_id       | YES          | INT64      | The ID number for the test in the Bonsai platform.                 |
| test\_type     | YES          | STRING     | The type of test.                                                  |
| metric\_name   | YES          | STRING     | The name of the business metric measured in the test.              |
| lift           | YES          | FLOAT64    | The test result lift metric for a Bonsai test.                     |
| CI             | YES          | STRING     | The confidence interval level for the test result.                 |
| lower\_CI      | YES          | FLOAT64    | The lower bound of the lift result for the given confidence level. |
| higher\_CI     | YES          | FLOAT64    | The upper bound of the lift result for the given confidence level. |

</details>
