diff --git a/docs/integrations/event_webhook.mdx b/docs/integrations/event_webhook.mdx index cb70e54f9..0a6427876 100644 --- a/docs/integrations/event_webhook.mdx +++ b/docs/integrations/event_webhook.mdx @@ -87,7 +87,8 @@ Below are a few examples of some of the config change payloads. To best capture { "user": { "name": "Test User", - "email": "testuser@email.com" + "email": "testuser@email.com", + "userID": "user_12345" }, "timestamp": 1709660061095, "eventName": "statsig::config_change", @@ -95,7 +96,8 @@ Below are a few examples of some of the config change payloads. To best capture "type": "Gate", "name": "layout_v2", "description": "Description: Change default page layout", - "action": "created" + "action": "created", + "environment": "production" } } ``` @@ -106,7 +108,8 @@ Below are a few examples of some of the config change payloads. To best capture { "user": { "name": "Test User", - "email": "testuser@email.com" + "email": "testuser@email.com", + "userID": "user_12345" }, "timestamp": 1709658507446, "eventName": "statsig::config_change", @@ -114,7 +117,8 @@ Below are a few examples of some of the config change payloads. To best capture "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" } } ``` @@ -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) \ No newline at end of file +![Debug Tool](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/ak7zkUsSoHh2VQAhtjtL/5e14e128-1fd4-46f9-8543-364f9b9819bb.png) diff --git a/docs/integrations/snippets/integration_event_formats.mdx b/docs/integrations/snippets/integration_event_formats.mdx index be4145c3e..6ab5f8e1f 100644 --- a/docs/integrations/snippets/integration_event_formats.mdx +++ b/docs/integrations/snippets/integration_event_formats.mdx @@ -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": "a.user@email.com" + "email": "a.user@email.com", + "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": { @@ -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": "user@example.com", + "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", @@ -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": "user@example.com", + "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", @@ -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": "user@example.com", + "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", @@ -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": "user1@example.com", + "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": "user1@example.com", + "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": "user1@example.com", + "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" }