Skip to content

Commit

Permalink
[fix] gtag events
Browse files Browse the repository at this point in the history
  • Loading branch information
cupoftea4 committed Nov 17, 2024
1 parent 25aafe0 commit 940f4cc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hooks/useGTagTimetableEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { useEffect } from "react";

const useGTagTimetableEvents = (group: string, source: string, isCustomSource?: boolean) => {
useEffect(() => {
window.gtag("event", `open_${group}`, {
window.gtag("event", "open_timetable", {
event_category: "Timetable",
event_label: group,
});
}, [group]);

useEffect(() => {
window.gtag("event", `open_timetable_from_${source ?? "url"}`, {
window.gtag("event", "open_timetable_from", {
event_category: "Timetable",
event_label: group,
source: source ?? "url",
event_label: source ?? "url",
isCustomSource,
group,
});
Expand Down

0 comments on commit 940f4cc

Please sign in to comment.