Skip to content

Commit 1983b5c

Browse files
committed
fix(google-analytics): migrate ga() calls to gtag()
1 parent 6f9a7de commit 1983b5c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Diff for: client/src/document/index.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ export function Document(props /* TODO: define a TS interface for this */) {
147147
// I.e. not the initial load but the location has now changed.
148148
// Note that in local development, where you use `localhost:3000`
149149
// this will always be true because it's always client-side navigation.
150-
gtag("set", "dimension19", "Yes");
151-
gtag("send", {
152-
hitType: "pageview",
153-
location,
150+
gtag("event", "pageview", {
151+
dimension19: "Yes",
152+
page_location: location,
154153
});
155154
gleanClick(`${CLIENT_SIDE_NAVIGATION}: ${location}`);
156155
}

Diff for: client/src/site-search/index.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ export function SiteSearch() {
4141
// I.e. not the initial load but the location has now changed.
4242
// Note that in local development, where you use `localhost:3000`
4343
// this will always be true because it's always client-side navigation.
44-
gtag("set", "dimension19", "Yes");
45-
gtag("send", {
46-
hitType: "pageview",
47-
location,
44+
gtag("event", "pageview", {
45+
dimension19: "Yes",
46+
page_location: location,
4847
});
4948
gleanClick(`${CLIENT_SIDE_NAVIGATION}: ${location}`);
5049
}

0 commit comments

Comments
 (0)