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

Commit

Permalink
Hash routing hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed Jun 25, 2021
1 parent 0a3096c commit 3d217b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const AuthExample = () => {
const { signOut } = useEasybase();
return (
<Auth
theme="material"
signUpFields={{
lastName: { minLength: { message: "Must be 14 characters", value: 14 } },
phoneNumber: true,
Expand Down
6 changes: 6 additions & 0 deletions src/EasybaseProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ const EasybaseProvider = ({ children, ebconfig, options }: EasybaseProviderProps
g.analyticsEvent = (eventTitle: string, params?: Record<string, any>) => ga4React.gtag('event', eventTitle, params);
g.analyticsIdentify = (hashedUserId: string) => ga4React.gtag('config', options.googleAnalyticsId, { user_id: hashedUserId });
g.analyticsEnabled = true;
if (window.location.hash) {
// Using hash router - https://github.com/unrealmanu/ga-4-react/issues/15
window.onhashchange = () => {
ga4React.pageview(window.location.hash);
};
}
} catch (error) {
log("Analytics initialization error: ", error)
}
Expand Down

0 comments on commit 3d217b3

Please sign in to comment.