Skip to content

Commit

Permalink
Merge pull request #823 from cboard-org/feature/azure-insights
Browse files Browse the repository at this point in the history
Added Azure application insights
  • Loading branch information
martinbedouret authored Jan 24, 2021
2 parents 6d932ab + 6c59379 commit d14a519
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@material-ui/core": "^4.9.0",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.46",
"@microsoft/applicationinsights-web": "^2.5.11",
"@redux-beacon/google-analytics-gtag": "^1.0.2",
"@redux-beacon/logger": "^1.0.0",
"@redux-beacon/offline-web": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
https://ssl.gstatic.com
https://www.youtube.com/
https://*.cloudfront.net/
https://*.visualstudio.com/
blob:
gap:
data:;
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export const TAWASOL_BASE_PATH_API =
'https://madaportal.org/tawasol/wp-json/custom/v2/dea44ade76/';
export const TAWASOL_BASE_IMAGE_URL =
'https://www.madaportal.org/tawasol/wp-content/uploads/images/';
export const AZURE_INST_KEY = process.env.AZURE_INST_KEY || null;
13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ import LanguageProvider from './providers/LanguageProvider';
import SpeechProvider from './providers/SpeechProvider';
import ThemeProvider from './providers/ThemeProvider';
import configureStore, { getStore } from './store';
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import { AZURE_INST_KEY } from './constants';

if (AZURE_INST_KEY) {
const appInsights = new ApplicationInsights({
config: {
instrumentationKey: AZURE_INST_KEY,
enableAutoRouteTracking: true,
loggingLevelTelemetry: 2
}
});
appInsights.loadAppInsights();
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
}
const { persistor } = configureStore();
const store = getStore();
const dndOptions = {
Expand Down

0 comments on commit d14a519

Please sign in to comment.