Log Custom Exposure Events
Manually logs exposure events for experiments or feature gates. Useful for analytics-only experiments, delayed exposure logging, or when automatic exposure l…
Manually logs exposure events for experiments or feature gates. Useful for analytics-only experiments, delayed exposure logging, or when automatic exposure logging is disabled.
https://api.statsig.com/v1/log_custom_exposureAuthorizations
statsig-api-keystringrequiredapiKey (header)
Body
application/jsonexposuresobject[]requiredArray of exposure events to log
Show child attributes
experimentNamestringName of the experiment or dynamic config
min length: 1userobjectUser object containing identification and attributes for evaluation. At minimum, provide at least one identifier.
userIDstringPrimary user identifier
user-123emailstringUser email address
user@example.comformat: emailipstringUser IP address for geo-targeting
192.168.1.1userAgentstringUser agent string for device/browser targeting
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36countrystring2-letter country code (ISO 3166-1 alpha-2)
USlocalestringLocale/language code
en_USappVersionstringApplication version
1.2.3customobjectCustom user attributes for targeting (string, number, boolean, or array of strings)
{"subscription_plan":"premium","account_age_days":45,"is_beta_tester":true}privateAttributesobjectPrivate attributes used for evaluation but not logged to analytics
{"internal_user_id":"12345"}customIDsobjectAdditional custom identifier mappings
{"companyID":"company-456","deviceID":"device-789"}statsigEnvironmentobjectEnvironment tier for targeting
tierstringEnvironment tier
productionstagingdevelopmentgroupstringGroup name (use this OR ruleID)
min length: 1ruleIDstringRule ID (use this OR group)
timeoneOfExposure timestamp
integer (format: int64)stringsecondaryExposuresobject[]gatestringrequiredName of the gate
gateValuestringrequiredGate value as string ('true' or 'false')
ruleIDstringrequiredRule ID that was evaluated
gateNamestringName of the feature gate
min length: 1passesbooleanWhether the gate passed
userobjectShared user object for all exposures
Show child attributes
userIDstringPrimary user identifier
user-123emailstringUser email address
user@example.comformat: emailipstringUser IP address for geo-targeting
192.168.1.1userAgentstringUser agent string for device/browser targeting
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36countrystring2-letter country code (ISO 3166-1 alpha-2)
USlocalestringLocale/language code
en_USappVersionstringApplication version
1.2.3customobjectCustom user attributes for targeting (string, number, boolean, or array of strings)
{"subscription_plan":"premium","account_age_days":45,"is_beta_tester":true}privateAttributesobjectPrivate attributes used for evaluation but not logged to analytics
{"internal_user_id":"12345"}customIDsobjectAdditional custom identifier mappings
{"companyID":"company-456","deviceID":"device-789"}statsigEnvironmentobjectEnvironment tier for targeting
tierstringEnvironment tier
productionstagingdevelopmentstatsigMetadataobjectSDK metadata for tracking SDK type, version, and other diagnostic information
{"sdkType":"js-client","sdkVersion":"4.20.0","exposureLoggingDisabled":false}Show child attributes
sdkTypestringSDK type sending the request (e.g., js-client)
sdkVersionstringSDK version
exposureLoggingDisabledbooleanWhen true, prevents the HTTP API from automatically logging exposures. Use this only if you will handle exposure logging yourself.
Response
application/jsonsuccessbooleanrequiredWhether the request was successful
Was this helpful?