Skip to content

Commit

Permalink
Merge pull request #476 from microbit-foundation/475-only-activate-ap…
Browse files Browse the repository at this point in the history
…p-insights-on-the-ml-machineorg-site

Make app insights hostname dependent
  • Loading branch information
r59q authored May 23, 2024
2 parents 9e3d85f + 6e850e3 commit a90b7f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import CookieManager from './script/CookieManager';

const load = () => {
if (location.hostname !== "ml-machine.org") {
return;
}
if (CookieManager.getComplianceChoices().analytics) {
appInsights.loadAppInsights();
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
Expand Down

0 comments on commit a90b7f1

Please sign in to comment.