Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed people filters breaking in staging #645

Merged
31 changes: 20 additions & 11 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
import wrapPageElementWithTransition from 'helpers/wrapPageElement';
import React from 'react';
import AppProvider from 'store/provider';
import wrapPageElementWithTransition from 'helpers/wrapPageElement';
// import { isChinaBuild } from 'helpers/chinaHelper';
// import axios from 'axios';
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
// import { siteUrlCn } from './site-config.js';

const appInsights = new ApplicationInsights({
config: {
instrumentationKey: process.env.APPINSIGHTS_INSTRUMENTATIONKEY,
},
});
appInsights.loadAppInsights();
appInsights.addTelemetryInitializer((item) => {
item.tags['ai.cloud.role'] = 'SSW.People-StaticClientPage';
});
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
const instrumentationKey = process.env.APPINSIGHTS_INSTRUMENTATIONKEY;

if (!instrumentationKey) {
console.warn('APPINSIGHTS_INSTRUMENTATIONKEY is not set');
} else {
try {
const appInsights = new ApplicationInsights({
config: {
instrumentationKey,
},
});
appInsights.loadAppInsights();
appInsights.addTelemetryInitializer((item) => {
item.tags['ai.cloud.role'] = 'SSW.People-StaticClientPage';
});
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
} catch (error) {
console.error('Error initializing Application Insights', error);
}
}
// React Context in Browser
// eslint-disable-next-line react/prop-types
export const wrapRootElement = ({ element }) => {
Expand Down
Loading