Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Story/google analytics #48

Merged
merged 18 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added arguments to pageChange and pageTitleAsScreen calls
  • Loading branch information
ksiegel1923 committed Jul 30, 2021
commit 28e00ed62bf30962e2487676403d0435bfb2eb7b
8 changes: 4 additions & 4 deletions feedback-module/src/components/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function Module({ pagetitle, endpoint, dir }) {
focusFirstError();
} else {
updateOtherField();
pageTitleAsScreen;
pageChange;
pageTitleAsScreen(en(screen.title));
pageChange(en(screen.title), en(SCREENS[nextScreen].title));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be en(screen.title, { page: pagetitle }) (same for other one) bc of the string interpolation in our translation config.

sendFormData(screen.formID),
setScreen(SCREENS[nextScreen]),
setCheckboxError(false);
Expand All @@ -135,8 +135,8 @@ function Module({ pagetitle, endpoint, dir }) {
updateFeedbackForAPI(setFeedbackType, [en(text), feedbackID]);
setScreen(SCREENS[nextScreen]);
setCheckboxError(false);
pageTitleAsScreen;
pageChange;
pageTitleAsScreen(en(screen.title));
pageChange(en(screen.title), en(SCREENS[nextScreen].title));
}

headerRef.current.scrollIntoView(true);
Expand Down
2 changes: 1 addition & 1 deletion feedback-module/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const renderApp = (Div, lang, pagetitle, endpoint, gaid) => {
const ga4react = new GA4React(gaid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to create a new GA4React object every time the app is re-rendered (i.e. could we put this line outside of the renderApp function)? Not too familiar with how GA4React works, so I'm just wondering.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now we are getting the gaid attribute within the render app which is why I put this here. I guess we could make the assumption that the user won't change their gaid so we wouldn't need to observe for it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm that's a good point— I guess we can keep it how it is just in case?

(async () => {
await ga4react
.initialize({ send_page_view: false })
.initialize()
.then((res) => console.log(`Analytics Success: ${res} ${gaid}`))
.catch((err) => console.log(`Analytics Failure: ${err}`))
.finally(() => {
Expand Down