Skip to content

Commit 7e0d4b1

Browse files
committed
feat: Enhance tracking functions to include home URL for better analytics context
1 parent 55e2f12 commit 7e0d4b1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.vitepress/theme/analytics.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ export const getQueryParameter = (name: string) => {
8787
};
8888

8989
export const trackLinkClick = (url: string, email: string = "", cId: string = "") => {
90-
inHouseAnalytics("linkClick_docs",{ url });
90+
inHouseAnalytics("linkClick_docs",{ url, email, cId, home_url: window.location.href });
9191
};
9292

9393
export const trackScroll = (value: number) => {
94-
inHouseAnalytics("scroll_docs", {event:"scrolled 50% on homepage"});
94+
inHouseAnalytics("scroll_docs", {event:"scrolled 50% on homepage", home_url: window.location.href});
9595
};
9696

9797
export const trackFormSubmission = (value: [string]) => {
98-
inHouseAnalytics("formSubmission_docs", {event:"contact us form submission"});
98+
inHouseAnalytics("formSubmission_docs", {event:"contact us form submission", home_url: window.location.href});
9999
};
100100

101101
export const trackVideoStart = (value: boolean) => {
102-
inHouseAnalytics("videoView_docs", {event:"Penify.dev video tuts"});
102+
inHouseAnalytics("videoView_docs", {event:"Penify.dev video tuts", home_url: window.location.href});
103103
};

0 commit comments

Comments
 (0)