Skip to content

Commit acc6458

Browse files
committed
feat:added google tag stats to monitor analytics
1 parent 655ceb9 commit acc6458

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/CatalogueContent.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,21 @@ const CatalogueContent = () => {
149149
);
150150

151151
const handleDownloadAll = useCallback(async () => {
152+
if (typeof window !== "undefined" && window.gtag) {
153+
window.gtag("event", "download_all_clicked", {
154+
event_category: "Paper Downloads",
155+
event_label: "Download All Clicked",
156+
});
157+
}
158+
152159
for (const paper of selectedPapers) {
153160
const extension = paper.finalUrl.split(".").pop();
154161
const fileName = `${extractBracketContent(paper.subject)}-${paper.exam}-${paper.slot}-${paper.year}.${extension}`;
155162
await downloadFile(paper.finalUrl, fileName);
156163
}
157164
}, [selectedPapers]);
158165

166+
159167
const handleApplyFilters = useCallback(
160168
(
161169
exams: string[],
@@ -198,7 +206,7 @@ const CatalogueContent = () => {
198206
const campusCondition = campus.length
199207
? campus.includes(paper.campus)
200208
: true;
201-
const answerkeyCondition = anskey ? paper.answerKeyIncluded ===true : true;
209+
const answerkeyCondition = anskey ? paper.answerKeyIncluded === true : true;
202210
return (
203211
examCondition &&
204212
slotCondition &&

0 commit comments

Comments
 (0)