Skip to content

Commit

Permalink
notice for missing ga code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mtillmann committed Aug 13, 2023
1 parent b5d0f44 commit 8f1e6b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/Frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ window.addEventListener('DOMContentLoaded', () => {
window.st = new ShepherdTour();


fetch('ga-code').then(r => r.text())
fetch('ga-code')
.then(e => {
if(e.ok){
return e.text()
}
else{
console.log('No Analytics Code found. Place a file called "ga-code" in the root of the webserver (/static).');
}
})
.then(code => {
window.GACODE = code;
if (!localStorage.getItem('ct-analytics-state')) {
Expand All @@ -70,6 +78,8 @@ window.addEventListener('DOMContentLoaded', () => {
window.st.show();
}
});


})

window.APP = {
Expand Down
12 changes: 11 additions & 1 deletion static/app.js

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

0 comments on commit 8f1e6b5

Please sign in to comment.