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

Add Google Analytics to the site #247

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
});
}

async function loadGA() {

Check failure on line 18 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

'loadGA' is defined but never used
const gaId = 'G-9SEQK7FPPQ';
loadGAScript(`https://www.googletagmanager.com/gtag/js?id=${gaId}`, () => {

Check failure on line 20 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

'loadGAScript' is not defined
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }

Check failure on line 22 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

'dataLayer' is not defined

Check failure on line 22 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

Use the rest parameters instead of 'arguments'
gtag('js', new Date());
gtag('config', gaId);
});
}

store.emit('delayed:loaded');

loadCSS(`${window.hlx.codeBasePath}/styles/icons.css`);
Expand Down
Loading