-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(widget): google analytics dimension for injected widget app id #3272
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soft approve
@@ -93,6 +96,15 @@ export function useAnalyticsReporter() { | |||
googleAnalytics.setDimension(Dimensions.market, marketDimension) | |||
}, [marketDimension]) | |||
|
|||
useEffect(() => { | |||
// Custom dimension 6 - injected widget app id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add it also in Google Analytics side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was your idea at the last meeting 😄
const APP_CODE = process.env.REACT_APP_APP_CODE | ||
|
||
export function useAppData(): AppDataInfo | null { | ||
return useAtomValue(appDataInfoAtom) | ||
} | ||
|
||
export function useAppCode(): string | null { | ||
const injectedWidgetMetaData = useAtomValue(injectedWidgetMetaDataAtom) | ||
const injectedWidgetMetaData = useInjectedWidgetMetaData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick
not comming from this PR, but in principle not sure we want to make all modules aware there's an injected mode and instead is the client of this module informing one time whats the appKey
This way, in injected mode, it will inject the appData, otherwise it will get it from the env.
Otherwise, we leak a lot of CoW Swap logic here. Imagine we want to promote this module to a lib and use for other projects, then the injected mode would be bothering us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also feel it's not the best solution. However, I don't see any better ways
Summary
appId
toappData
as an app codeappId
to google analytics dimension