Skip to content

Commit

Permalink
🔁 App Insights - Added filter to filter out google analytics with 0 c…
Browse files Browse the repository at this point in the history
…ode (#1593)

* added filter to filter out google analytics with 0 code

* marking 0 result code as success for analytics
  • Loading branch information
babakamyljanovssw authored Oct 28, 2024
1 parent 3ce3797 commit 9a65312
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hooks/useAppInsights.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export default function useAppInsights() {
ai.loadAppInsights();
ai.addTelemetryInitializer((item) => {
item.tags['ai.cloud.role'] = 'SSW.Rules-StaticClientPage';

if (
item.baseData?.target?.includes('analytics.google.com') &&
item.baseData?.responseCode == 0
) {
// mark these as successful requests as per this comment - https://github.com/SSWConsulting/SSW.Rules/issues/1589#issuecomment-2437107468
item.baseData.success = true;
}
});
}

Expand Down

0 comments on commit 9a65312

Please sign in to comment.