Skip to content

Commit 3fc5333

Browse files
authored
Merge pull request #1277 from isaacphysics/add-glossary-view-logged-event
Add log event for glossary page view
2 parents e0a5d3b + b9fcb6c commit 3fc5333

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/components/pages/Glossary.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, {useEffect, useMemo, useRef, useState} from "react";
22
import {Col, Container, Input, Label, Row} from "reactstrap";
33
import queryString from "query-string";
4-
import {AppState, useAppSelector} from "../../state";
4+
import {AppState, logAction, useAppDispatch, useAppSelector} from "../../state";
55
import {ShowLoading} from "../handlers/ShowLoading";
66
import {TitleAndBreadcrumb} from "../elements/TitleAndBreadcrumb";
77
import {ShareLink} from "../elements/ShareLink";
@@ -98,6 +98,7 @@ function processQueryString(query: string): QueryStringResponse {
9898
const ALPHABET_HEADER_OFFSET = -65;
9999

100100
export const Glossary = () => {
101+
const dispatch = useAppDispatch();
101102
const location = useLocation();
102103
const history = useHistory();
103104
// query stages not used recently
@@ -121,6 +122,11 @@ export const Glossary = () => {
121122
)
122123
);
123124

125+
// Log on initial page load
126+
useEffect(() => {
127+
dispatch(logAction({type: "VIEW_GLOSSARY_PAGE"}));
128+
}, []);
129+
124130
// Update url
125131
useEffect(() => {
126132
const params: {[key: string]: string} = {};

0 commit comments

Comments
 (0)