fix(Codebytes): tracking tweaks for monolith#31
Conversation
| trackClick('lang_select'); | ||
| trackClick('lang_select', trackingData); | ||
| onLanguageChange?.(newText, newLanguage); | ||
| trackClick('lang_select'); |
| target: string, | ||
| trackingData: Omit<UserClickData, 'target'> | ||
| ) => { | ||
| if (trackingData) { |
There was a problem hiding this comment.
maybe we make comment about tech debt ticket here/mention homepage?
There was a problem hiding this comment.
100% good call. just wanted to see if you and @BandanaKM were okay with this stopgap approach
There was a problem hiding this comment.
yeah, think this works as a quick way to pass in the correct tracking data from monolith to avoid getting the weird values for clientName in all of our userClick events in the monolith.
we can definitely refactor this as a fast follow. ideally we can get rid of this file in the future and just have getOptions and all the relevant dependencies in the next.js version, since they were primarily intended for the query params
if we do end up passing in an object later with the tracking functions, we can definitely do that
| @@ -1,2 +1,2 @@ | |||
| export * from './codeByteEditor'; | |||
| export { LanguageOption, LanguageOptions } from './consts'; | |||
| export * from './consts'; | |||
There was a problem hiding this comment.
this was blocking us from being able to import in the monolith for some reason, so we're just gonna do this to unblock
📬Published Alpha Packages:@codecademy/codebytes@0.6.5-alpha.03a0b0.0 |
Overview
allow non iframe usages to pass in tracking data
this is necessary for importing and using the codebytes component in the monolith and having appropriate tracking data (since there won't be an iframe url to pull params from)
this is a stopgap for now and will be revisited in disc - 465 to think through a better solution
PR Checklist