* Log experiment exposure for a feature if it has experiment data. * Deduplicates within a session - each feature is logged at most once.
(feature: string)
| 294 | * Deduplicates within a session - each feature is logged at most once. |
| 295 | */ |
| 296 | function logExposureForFeature(feature: string): void { |
| 297 | // Skip if already logged this session (dedup) |
| 298 | if (loggedExposures.has(feature)) { |
| 299 | return |
| 300 | } |
| 301 | |
| 302 | const expData = experimentDataByFeature.get(feature) |
| 303 | if (expData) { |
| 304 | loggedExposures.add(feature) |
| 305 | logGrowthBookExperimentTo1P({ |
| 306 | experimentId: expData.experimentId, |
| 307 | variationId: expData.variationId, |
| 308 | userAttributes: getUserAttributes(), |
| 309 | experimentMetadata: { |
| 310 | feature_id: feature, |
| 311 | }, |
| 312 | }) |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Process a remote eval payload from the GrowthBook server and populate |
no test coverage detected