Skip to content

Commit d4f77ab

Browse files
update
1 parent c94f8f1 commit d4f77ab

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

articles/azure-app-configuration/feature-management-javascript-reference.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ The process of allocating a feature's variants is determined by the `allocation`
632632

633633
```json
634634
"allocation": {
635-
"default_when_enabled": "Small",
636635
"default_when_disabled": "Small",
636+
"default_when_enabled": "Small",
637637
"user": [
638638
{
639639
"variant": "Big",
@@ -843,7 +843,7 @@ The telemetry publisher sends `FeatureEvaluation` custom events to the Applicati
843843

844844
### Targeting telemetry processor
845845

846-
If you have implemented [`ITargetingContextAccessor`](#itargetingcontextaccessor), you can use the built-in Application Insights telemetry processor to automatically attached targeting id information to telemetry by calling `createTargetingTelemetryProcessor` function.
846+
If you have implemented [`ITargetingContextAccessor`](#itargetingcontextaccessor), you can use the built-in Application Insights telemetry processor to automatically attach targeting ID information to all telemetry by calling the `createTargetingTelemetryProcessor` function.
847847

848848
```typescript
849849
const appInsights = require("applicationinsights");
@@ -855,7 +855,17 @@ appInsights.defaultClient.addTelemetryProcessor(
855855
);
856856
```
857857

858-
This ensures that every telemetry sent to Application Insights includes the targeting id information, allowing you to correlate feature flag usage in your analytics.
858+
This ensures that every telemetry item sent to Application Insights includes the user's targeting ID information (userId and groups), allowing you to correlate feature flag usage with specific users or groups in your analytics.
859+
860+
If you are using the targeting telemetry processor, instead of calling the `trackEvent` method provided by the feature management package, you can directly call the `trackEvent` method from the Application Insights SDK. The targeting ID information will be automatically attached to the custom event telemetry's `customDimensions`.
861+
862+
```typescript
863+
// Instead of calling trackEvent and passing the app insights client
864+
// trackEvent(appInsights.defaultClient, "<TARGETING_ID>", {name: "TestEvent", properties: {"Tag": "Some Value"}});
865+
866+
// directly call trackEvent method provided by App Insights SDK
867+
appInsights.defaultClient.trackEvent({ name: "TestEvent" });
868+
```
859869

860870
## Next steps
861871

0 commit comments

Comments
 (0)