Skip to content
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
14 changes: 9 additions & 5 deletions docs/integrations/event_webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ Below are a few examples of some of the config change payloads. To best capture
{
"user": {
"name": "Test User",
"email": "[email protected]"
"email": "[email protected]",
"userID": "user_12345"
},
"timestamp": 1709660061095,
"eventName": "statsig::config_change",
"metadata": {
"type": "Gate",
"name": "layout_v2",
"description": "Description: Change default page layout",
"action": "created"
"action": "created",
"environment": "production"
}
}
```
Expand All @@ -106,15 +108,17 @@ Below are a few examples of some of the config change payloads. To best capture
{
"user": {
"name": "Test User",
"email": "[email protected]"
"email": "[email protected]",
"userID": "user_12345"
},
"timestamp": 1709658507446,
"eventName": "statsig::config_change",
"metadata": {
"type": "Experiment",
"name": "heading_test",
"description": "- Updated experiment settings\n - Groups updated: control, test\n - Parameters added: heading\n - Parameters updated: directives",
"action": "updated"
"action": "updated",
"environment": "production"
}
}
```
Expand Down Expand Up @@ -167,4 +171,4 @@ You can also use the **Debug** tool to
1. See requests made to the webhook, including diagnostic information such as number of events forwarded/filtered, request header & body, and more.
2. Send example requests to the webhook using any recently logged event or exposure

![Debug Tool](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/ak7zkUsSoHh2VQAhtjtL/5e14e128-1fd4-46f9-8543-364f9b9819bb.png)
![Debug Tool](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/ak7zkUsSoHh2VQAhtjtL/5e14e128-1fd4-46f9-8543-364f9b9819bb.png)
125 changes: 110 additions & 15 deletions docs/integrations/snippets/integration_event_formats.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ Events will be sent in batches in a JSON format. The structure of a Statsig Even
"eventName": "my_custom_event",
"user": {
"userID": "a_user",
"email": "[email protected]"
"email": "[email protected]",
"country": "US",
"locale": "en-US",
"appVersion": "1.2.3",
"custom": {
"subscription_tier": "premium",
"signup_date": "2024-01-15"
}
},
"userID": "a_user",
"timestamp": "1655231253265",
"statsigMetadata": {
...
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-12345",
"sessionID": "session-abc-123",
"environment": {"tier": "production"}
},
"value": "a_custom_value",
"metadata": {
Expand All @@ -46,10 +57,26 @@ Events will be sent in batches in a JSON format. The structure of a Statsig Even
```json
{
"eventName": "statsig::gate_exposure",
"user": { ... },
"user": {
"userID": "a_user",
"email": "[email protected]",
"country": "US",
"locale": "en-US",
"appVersion": "1.2.3",
"custom": {
"subscription_tier": "premium",
"signup_date": "2024-01-15"
}
},
"userID": "a_user",
"timestamp": "1655231253265",
"statsigMetadata": { ... },
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-67890",
"sessionID": "session-def-456",
"environment": {"tier": "production"}
},
"value": "",
"metadata": {
"gate": "a_gate",
Expand All @@ -70,10 +97,26 @@ Events will be sent in batches in a JSON format. The structure of a Statsig Even
```json
{
"eventName": "statsig::config_exposure",
"user": { ... },
"user": {
"userID": "a_user",
"email": "[email protected]",
"country": "US",
"locale": "en-US",
"appVersion": "1.2.3",
"custom": {
"subscription_tier": "premium",
"signup_date": "2024-01-15"
}
},
"userID": "a_user",
"timestamp": "1655231253265",
"statsigMetadata": { ... },
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-78901",
"sessionID": "session-ghi-789",
"environment": {"tier": "production"}
},
"value": "",
"metadata": {
"config": "a_config",
Expand All @@ -93,10 +136,26 @@ Events will be sent in batches in a JSON format. The structure of a Statsig Even
```json
{
"eventName": "statsig::experiment_exposure",
"user": { ... },
"user": {
"userID": "a_user",
"email": "[email protected]",
"country": "US",
"locale": "en-US",
"appVersion": "1.2.3",
"custom": {
"subscription_tier": "premium",
"signup_date": "2024-01-15"
}
},
"userID": "a_user",
"timestamp": "1655232119734",
"statsigMetadata": { ... },
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-89012",
"sessionID": "session-jkl-012",
"environment": {"tier": "production"}
},
"value": "",
"metadata": {
"config": "an_experiment",
Expand All @@ -118,35 +177,71 @@ Events will be sent in batches in a JSON format. The structure of a Statsig Even
[
{
"eventName": "page_view",
"user": {"userID": "user_1", "country": "US"},
"user": {
"userID": "user_1",
"country": "US",
"email": "[email protected]",
"locale": "en-US",
"appVersion": "2.1.0"
},
"userID": "user_1",
"timestamp": 1644520566967,
"value": "example_value",
"metadata": {"page": "home_page"},
"statsigMetadata": {},
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-batch-1",
"sessionID": "session-batch-abc",
"environment": {"tier": "production"}
},
"timeUUID": "f4c414a0-8ab5-11ec-a8a3-0242ac120002"
},
{
"eventName": "statsig::gate_exposure",
"user": {"userID": "user_1", "country": "US"},
"user": {
"userID": "user_1",
"country": "US",
"email": "[email protected]",
"locale": "en-US",
"appVersion": "2.1.0"
},
"userID": "user_1",
"timestamp": 1644520566968,
"value": "",
"metadata": {"gate": "test_gate", "gateValue": "true", "ruleID": "default"},
"statsigMetadata": {},
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-batch-1",
"sessionID": "session-batch-abc",
"environment": {"tier": "production"}
},
"timeUUID": "f4c414a0-8ab5-11ec-a8a3-0242ac120003",
"unitID": "userID"
},
{
"eventName": "statsig::experiment_exposure"
"user": {"userID": "user_1", "country": "US"},
"eventName": "statsig::experiment_exposure",
"user": {
"userID": "user_1",
"country": "US",
"email": "[email protected]",
"locale": "en-US",
"appVersion": "2.1.0"
},
"userID": "user_1",
"timestamp": 1644520566969,
"value": "",
"metadata": {
"config": "an_experiment", "ruleID": "4SauZJcM1T7zNvh1igBjwE", "reason": "Network", "time": "1655231249644", "experimentGroupName": "Control"
},
"statsigMetadata": {},
"statsigMetadata": {
"sdkType": "js-client",
"sdkVersion": "4.34.0",
"stableID": "stable-id-batch-1",
"sessionID": "session-batch-abc",
"environment": {"tier": "production"}
},
"timeUUID": "f4c414a0-8ab5-11ec-a8a3-0242ac120004",
"unitID": "userID"
}
Expand Down