[Feature]: More options how to filter click events
Is your feature request related to a problem? Please describe.
If you have APP 2 as a part of APP 1, there isn't any possibility of collecting clickanalytics events only from the inner (APP 2) application.
dntDataTag works the other way around. You can apply it to APP 2 and prevent APP 2 from collecting metrics.
Describe the solution you'd like
- I would implement filter callback that would be called when the event is processed. If the callback returns false, the event will be dropped.
Proposed interface
export interface IValueCallback {
dropEvent?: (event: ITelemetryItem): boolean;
}
- Or we can introduce something like
dontDntDataTagattribute that would capture events only from elements that have this parent attribute. You would apply it on root element of APP 2 and everything from APP 1 will be ignored.
Describe alternatives you've considered My current solution is to filter events by parentId in KQL.
Additional context If it makes sense to you, I'm willing to implement it.
one workaround is set parentDataTag https://github.com/microsoft/ApplicationInsights-JS/blob/767790b9011cc032dd9a9763fa7e6714de1cd527/extensions/applicationinsights-clickanalytics-js/src/Interfaces/Datamodel.ts#L83 of App2 to a different one, and mark app1 as do not track. please let us know if it works!
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.
Hello @Karlie-777 this would work if you were in a position where you can modify app1. Unfortunately, that is not my case.
Is there any tag id/properties/telemetry fields that can identify if the events are from app1 or app2? If it does, then you can apply telemetryInitializer https://github.com/microsoft/ApplicationInsights-JS?tab=readme-ov-file#telemetry-initializers this handler allows you to modify any events before sent out. So once you identify the events are from app1 and you return false inside telemetry initializer, then the events from app1 can be dropped.
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.