[delete][s]: remove gtag utility and only make use of the tracking id in _document.tsx

This commit is contained in:
steveoni 2020-11-30 13:28:12 +01:00
parent f2c9a1058c
commit 62c5a54f7f

View File

@ -1,19 +0,0 @@
export const GA_TRACKING_ID = 'G-NX72GYFHFS';
//https://developers.google.com/analytics/devguides/collection/gtagjs/pages
//eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const pageview = (url: string) => {
window.gtag('config', GA_TRACKING_ID, {
page_path: url,
});
};
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const event = ({ action, category, label, value }) => {
window.gtag('event', action, {
event_category: category,
event_label: label,
value: value,
});
};