-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4466 from galaxyproject/bowfin-gorgon
Fix analytics
- Loading branch information
Showing
3 changed files
with
33 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,38 @@ | ||
<!-- | ||
<script async defer data-domain="training.galaxyproject.org" src="https://plausible.galaxyproject.eu/js/plausible.js"></script> | ||
--> | ||
<!-- We let users opt-out, so if they've opted in, we need to append the plausible script to the body --> | ||
|
||
<script> | ||
var scriptElement = document.createElement("script"); | ||
scriptElement.async = true; | ||
scriptElement.defer = true; | ||
scriptElement.setAttribute("data-domain", "training.galaxyproject.org"); | ||
scriptElement.src = "https://plausible.galaxyproject.eu/js/plausible.js"; | ||
|
||
// Appending the script element to the body | ||
if(localStorage.getItem('plausible-opt-out') !== 'opt-out' && navigator.doNotTrack !== "1") { | ||
console.log("Plausible: opt-in"); | ||
// Wait for the document to be available | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.body.appendChild(scriptElement); | ||
}); | ||
} | ||
</script> | ||
|
||
<!-- JavaScript Error Monitoring, and performance tracking. --> | ||
<!-- | ||
<script | ||
src="https://browser.sentry-cdn.com/7.52.1/bundle.tracing.min.js" | ||
integrity="sha384-muuFXKS3752PNA4rPm9Uq6BLvOfV4CXyr9MHDBPvozOJJUWLKkogEFWOIRoVps43" | ||
crossorigin="anonymous" | ||
></script> | ||
--> | ||
<script type="text/javascript"> | ||
var scriptElement = document.createElement("script"); | ||
scriptElement.src = "https://browser.sentry-cdn.com/7.52.1/bundle.tracing.min.js"; | ||
scriptElement.integrity = "sha384-muuFXKS3752PNA4rPm9Uq6BLvOfV4CXyr9MHDBPvozOJJUWLKkogEFWOIRoVps43"; | ||
scriptElement.crossOrigin = "anonymous"; | ||
|
||
if(localStorage.getItem('sentry-opt-out') !== 'opt-out' && navigator.doNotTrack !== "1") { | ||
console.log("Sentry: opt-in"); | ||
// Appending the script element to the body | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.body.appendChild(scriptElement); | ||
}); | ||
|
||
Sentry.init({ | ||
dsn: "https://[email protected]/10", | ||
release: "galaxy-training-network@{{ site.git_revision }}", | ||
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], | ||
sampleRate: 0.1, | ||
tracesSampleRate: 0.1, | ||
// Capture Replay for no sessions by default | ||
replaysSessionSampleRate: 0.01, | ||
// plus for 1% of sessions with an error | ||
replaysOnErrorSampleRate: 0.01, | ||
// PII OFF | ||
sendDefaultPii: false, // Off by default but just in case. | ||
environment: "{{ jekyll.environment }}", | ||
dsn: "https://[email protected]/10", | ||
release: "galaxy-training-network@{{ site.git_revision }}", | ||
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], | ||
sampleRate: 0.1, | ||
tracesSampleRate: 0.1, | ||
// Capture Replay for no sessions by default | ||
replaysSessionSampleRate: 0.01, | ||
// plus for 1% of sessions with an error | ||
replaysOnErrorSampleRate: 0.01, | ||
// PII OFF | ||
sendDefaultPii: false, // Off by default but just in case. | ||
environment: "{{ jekyll.environment }}", | ||
}); | ||
} | ||
</script> | ||
|
||
<!-- Page view tracking --> | ||
<script async defer data-domain="training.galaxyproject.org" src="https://plausible.galaxyproject.eu/js/plausible.js"></script> | ||
<script> | ||
if(localStorage.getItem('plausible-opt-out') !== 'opt-out' && navigator.doNotTrack !== "1") { | ||
localStorage.removeItem("plausible_ignore") | ||
console.log("Plausible: opt-in"); | ||
} else { | ||
// if they're opting-out, or DNT | ||
// we might get one page by accident but we won't get future ones. | ||
localStorage.setItem("plausible_ignore", "true") | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters