Fix google analytics tracking

This commit is contained in:
Hazem Krimi
2022-02-17 13:03:17 +01:00
parent 08a003c2f0
commit 91773aac01
3 changed files with 13 additions and 12 deletions
-2
View File
@@ -1,6 +1,5 @@
export const GOOGLE_ANALYTICS_KEY = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_KEY;
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
export const pageview = (url: any) => {
// @ts-ignore
window.gtag('config', GOOGLE_ANALYTICS_KEY, {
@@ -8,7 +7,6 @@ export const pageview = (url: any) => {
});
};
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
export const event = ({ action, category, label, value }: any) => {
// @ts-ignore
window.gtag('event', action, {