init
This commit is contained in:
15
gtag.js
Normal file
15
gtag.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GOOGLE_ID || null;
|
||||
|
||||
export const pageview = (url) => {
|
||||
window.gtag("config", GA_TRACKING_ID, {
|
||||
page_path: url,
|
||||
});
|
||||
};
|
||||
|
||||
export const event = ({ action, category, label, value }) => {
|
||||
window.gtag("event", action, {
|
||||
event_category: category,
|
||||
event_label: label,
|
||||
value: value,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user