Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cleanup tables #1908

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/client/concepts/user.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Auto-inferred User Attributes can be used for both Targeting and Results Segment

## User Attributes

```
| Attributes | Description | Key | Example | Client SDK Support | Auto-infer |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----- | ----- |
| User ID | ID representing a unique user. This ID will be used to guarantee consistency of targeting for Feature Gates and Experiments and will be used to evaluate experiment results. If `User ID` doesn't exist yet, leave this empty; a `Stable ID` persisted locally will be used for evaluations. | `userID` | `your_user_id` | All |
Expand All @@ -32,7 +31,6 @@ Auto-inferred User Attributes can be used for both Targeting and Results Segment
| Custom | Dictionary that can contain key/value pairs that can be used for Feature Gate targeting. The content of this dictionary will be stored and available after targeting | `custom` | `{current_page: "/homepage", ...}` | All | |
| Private Attibutes | Dictionary that can contain key/value pairs that can be used for Feature Gate targeting. The content of this dictionary will **not** be stored after used for targeting and will be removed from any log_event calls | `privateAttributes` | `{sensitive_field: "sensitive_information", ...}` | All | |
| Custom IDs | Dictionary that can contain key/value pairs used as the randomization unit ID for experiments that are set up using these IDs instead of the `User ID` | `customIDs` | `{account_id: "23456555", company_id: "company_xyz"}` | All | |
```

### DateTime targeting
All SDKs support unix timestamps to evaluate time based conditions (After time, before time). Without knowing all possible variations of DateTime formats, we have to normalize on something, so its best to convert your DateTime field into a standard format for evaluation.
Expand Down
38 changes: 19 additions & 19 deletions docs/data-warehouse-ingestion/data_mapping.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@ Please note that we will cast fields into the appropriate type. For example, Sta
Events that are emitted by your application to measure the ongoing impact of your features and experiments.

#### Required
```

| Column | Description | Format/Rules |
| ---------- | -------------------------------------- | --------------------------------------------------------------------------------- |
| timestamp | The unix time your event was logged at | BIGINT. please cast timestamps into epoch time in seconds |
| event_name | The name of the event | STRING/VARCHAR. Not null. Length < 128 characters |
| unit_id | Unique unit identifier | STRING/VARCHAR. User ID, Stable ID, etc. The same event row can have multiple IDs |
```


#### Optional
```

| Column | Description | Rules |
| -------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| event_value | The value of the event | STRING/VARCHAR. Length < 128 characters. Statsig will detect numeric values |
| event_metadata | Metadata columns about the event | (MANY) STRING:STRING. Statsig will generate a metadata json field from however many metadata columns you provide |
| metadata_json | Metadata json about the event | JSON STRING. Statsig will unpack this json 1 level deep. Nested values will be stored as strings |
```


<br />

An example dataset for events might look like this:

```

| unit_id | visit_id | event | timestamp | value | metadata_blob | user_type |
| ------- | -------- | -------- | ---------- | ----- | -------------------------------------------------------- | --------------- |
| 331444 | | click | 1676484875 | | {"click_target": "exit_details_button"} | power_user |
| 331444 | | click | 1676484860 | | {"click_target": "open_details_button"} | power_user |
| 265113 | | click | 1676484333 | | {"click_target": "button", "button_color": "green"} | churn_risk_user |
| 445332 | aeeer43d | visit | 1676483821 | | {"page": "landing_page"} | new_user |
| 224448 | | checkout | 1676482222 | 33.22 | {"product_id": "11eefj", "product_category": "clothing"} | power_user |
```
| 331444 | | click | 1676484875 | | `{"click_target": "exit_details_button"}` | power_user |
| 331444 | | click | 1676484860 | | `{"click_target": "open_details_button"}` | power_user |
| 265113 | | click | 1676484333 | | `{"click_target": "button", "button_color": "green"}` | churn_risk_user |
| 445332 | aeeer43d | visit | 1676483821 | | `{"page": "landing_page"}` | new_user |
| 224448 | | checkout | 1676482222 | 33.22 | `{"product_id": "11eefj", "product_category": "clothing"}` | power_user |


Note that:

Expand All @@ -69,7 +69,7 @@ Precomputed metrics are a powerful way to leverage statsig for experiment result
Precomputed metrics in statsig are expected to be calculated at a user-day granularity.

#### Required
```

| Column | Description | Format/Rules |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| unit_id | The unique user identifier this metric is for. This might not necessarily be a user_id - it could be a custom_id of some kind | STRING |
Expand All @@ -79,18 +79,18 @@ Precomputed metrics in statsig are expected to be calculated at a user-day granu
| metric_value | A numeric value for the metric | DOUBLE/NUMERIC. Metric value <br/><b>OR</b><br/> Both of numerator/denominator need to be provided for Statsig to process the metric. |
| numerator | Numerator for metric calculation | DOUBLE/NUMERIC. If present along with a denominator in any record, the metric will be treated as ratio and only calculated for users with non-null denominators. |
| denominator | Denominator for metric calculation | DOUBLE/NUMERIC. If present along with a numerator in any record, the metric will be treated as ratio and only calculated for users with non-null denominators. |
```

<br />

An example dataset for metrics might look like this:
```

| unit_id | unit_type | date | metric_name | metric_value | numerator | denominator |
| -------- | --------- | ---------- | ----------------------- | ------------ | --------- | ----------- |
| 331444 | user_id | 2023-02-13 | clicks | 2 | | |
| aeeer43d | visit_id | 2023-02-13 | visits | 1 | | |
| 224448 | user_id | 2023-02-13 | checkout_rate | | 2 | 15 |
| 224448 | user_id | 2023-02-13 | clothing_checkout_value | 33.22 | | |
```

Note that:

- In this dataset, unit types are in different rows from each other
Expand All @@ -110,18 +110,18 @@ NOTE: Exposure event import is deprectated. If this is an important use case, se
Exposure events are generated by your assignment tool, when it assigns your users to a certain variant of an experiment (e.g., show ad vs. hide ad).

#### Required
```

| Column | Description | Format/Rules |
| ---------- | ------------------------------------------- | --------------------------------------------------------------------------------- |
| timestamp | The unix time your event was logged at | BIGINT. please cast timestamps into timezoneless unix time |
| experiment | Your experiment identifier | STRING/VARCHAR. Not null. Length < 128 characters |
| group_id | Unique identifier for the experiment groups | STRING/VARCHAR. Not null. |
| unit_id | Unique user identifier | STRING/VARCHAR. User ID, Stable ID, etc. The same event row can have multiple IDs |
```


#### Optional
```

| Column | Description | Rules |
| ------------- | ----------------------------- | ------------------------------------------------------------------------------------------------ |
| metadata_json | Metadata json about the event | JSON STRING. Statsig will unpack this json 1 level deep. Nested values will be stored as strings |
```

Loading