mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 12:57:48 +00:00
remove route groups
This commit is contained in:
@@ -59,7 +59,8 @@ export type TrackEventArgs = { name: string; data?: object };
|
|||||||
export const trackEvent = (eventArgs?: string | TrackEventArgs): void => {
|
export const trackEvent = (eventArgs?: string | TrackEventArgs): void => {
|
||||||
if (!eventArgs || ENV.TEST) return;
|
if (!eventArgs || ENV.TEST) return;
|
||||||
|
|
||||||
const path = page.route.id ?? '';
|
const path = page.route.id?.replace(/\(([^()]*)\)/g, '') ?? '';
|
||||||
|
console.log(path);
|
||||||
const name = typeof eventArgs === 'string' ? eventArgs : eventArgs.name;
|
const name = typeof eventArgs === 'string' ? eventArgs : eventArgs.name;
|
||||||
const data = typeof eventArgs === 'string' ? { path } : { ...eventArgs.data, path };
|
const data = typeof eventArgs === 'string' ? { path } : { ...eventArgs.data, path };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user