forked from RabbyHub/Rabby
-
Notifications
You must be signed in to change notification settings - Fork 0
# Sequence diagram for desktop navigation GA and Matomo tracking #51
Copy link
Copy link
Open
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filedocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightjavascriptPull requests that update javascript codePull requests that update javascript codequestionFurther information is requestedFurther information is requested
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filedocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightjavascriptPull requests that update javascript codePull requests that update javascript codequestionFurther information is requestedFurther information is requested
Projects
Status
Backlog
Status
Todo
Reviewer's Guide
Implements GA4 and Matomo analytics events for desktop navigation activity and swap "to token" selection, centralizing desktop nav tracking and adding token selector callbacks for recent token interactions.
Sequence diagram for desktop navigation GA and Matomo tracking
sequenceDiagram actor User participant DesktopNav participant reportNavEvent participant matomoRequestEvent participant ga4 User->>DesktopNav: navigate to new desktop route DesktopNav->>DesktopNav: compute currentPathname DesktopNav->>DesktopNav: activeNav = navs.find(item.key prefix) DesktopNav->>DesktopNav: useEffect on activeNav.eventKey alt activeNav has eventKey DesktopNav->>reportNavEvent: reportNavEvent(eventKey) Note over reportNavEvent: debounced 300ms reportNavEvent->>matomoRequestEvent: matomoRequestEvent({ category: RabbyWeb_Active, action: RabbyWeb_<eventKey> }) reportNavEvent->>ga4: fireEvent(RabbyWeb_Active, { event_category: RabbyWeb_<eventKey> }) else no eventKey DesktopNav-->>DesktopNav: no tracking endSequence diagram for swap to-token selection analytics
sequenceDiagram actor User participant SwapTokenItem participant TokenSelect participant TokenSelector participant matomoRequestEvent participant ga4 User->>SwapTokenItem: click to select to-token alt TokenSelect closed SwapTokenItem->>TokenSelect: open token selector TokenSelect->>TokenSelect: setTokenSelectorVisible(true) TokenSelect->>TokenSelect: onOpenTokenModal() TokenSelect->>SwapTokenItem: onOpenTokenModal callback SwapTokenItem->>matomoRequestEvent: matomoRequestEvent({ category: TokenSelect, action: Swap_To_Token }) SwapTokenItem->>ga4: fireEvent(Swap_To_Token, { event_category: TokenSelect }) end User->>TokenSelector: click recent token TokenSelector->>TokenSelector: onConfirm(token) TokenSelector->>TokenSelector: onSelectRecentToken(token) TokenSelector->>TokenSelect: onConfirm(token) TokenSelector->>SwapTokenItem: onSelectRecentToken callback SwapTokenItem->>matomoRequestEvent: matomoRequestEvent({ category: TokenSelect, action: Swap_To_Token_Recent }) SwapTokenItem->>ga4: fireEvent(Swap_To_Token_Recent, { event_category: TokenSelect })Updated class diagram for desktop navigation and token selection tracking
classDiagram class DesktopNav { +DesktopNavAction action +boolean showRightItems +DesktopNavProps props -DesktopNavNavItem[] navs -DesktopNavNavItem activeNav +handleActionClick(nextAction DesktopNavAction) void } class DesktopNavNavItem { +string key +ReactComponentType icon +string title +boolean isSoon +string eventKey } class reportNavEvent { +reportNavEvent(eventKey string) void } class matomoRequestEvent { +matomoRequestEvent(options MatomoEventOptions) void } class ga4 { +fireEvent(name string, params GA4Params) void } class MatomoEventOptions { +string category +string action } class GA4Params { +string event_category } class SwapTokenItem { +boolean isFrom +onStartSelectChain() void +onOpenTokenModal() void +onSelectRecentToken(token TokenItem) void } class TokenSelect { +type TokenSelectType +onOpenTokenModal() void +onSelectRecentToken(token TokenItem) void +openTokenSelector() void } class TokenSelector { +onConfirm(token TokenItem) void +onSelectRecentToken(token TokenItem) void } class TokenItem { +string id +string symbol +string chain } DesktopNav "1" o-- "many" DesktopNavNavItem : navs DesktopNav --> reportNavEvent : uses reportNavEvent --> matomoRequestEvent : calls reportNavEvent --> ga4 : calls matomoRequestEvent --> MatomoEventOptions : parameter ga4 --> GA4Params : parameter SwapTokenItem --> TokenSelect : renders TokenSelect --> TokenSelector : renders TokenSelector --> TokenItem : selects SwapTokenItem --> matomoRequestEvent : onOpenTokenModal,onSelectRecentToken SwapTokenItem --> ga4 : onOpenTokenModal,onSelectRecentToken TokenSelect --> SwapTokenItem : callbacks TokenSelector --> SwapTokenItem : onSelectRecentToken callback TokenSelector --> TokenSelect : onConfirm callbackFile-Level Changes
src/ui/component/DesktopNav/index.tsxsrc/ui/views/DesktopProfile/index.tsxsrc/ui/views/Swap/Component/Token.tsxsrc/ui/component/TokenSelector/index.tsxsrc/ui/component/TokenSelect/index.tsxTips and commands
Interacting with Sourcery
@sourcery-ai reviewon the pull request.issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it.@sourcery-aianywhere in the pullrequest title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time.@sourcery-ai summaryanywhere inthe pull request body to generate a PR summary at any time exactly where you
want it. You can also comment
@sourcery-ai summaryon the pull request to(re-)generate the summary at any time.
@sourcery-ai guideon the pullrequest to (re-)generate the reviewer's guide at any time.
@sourcery-ai resolveon thepull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
@sourcery-ai dismisson the pullrequest to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!Customizing Your Experience
Access your dashboard to:
summary, the reviewer's guide, and others.
Getting Help
Originally posted by @sourcery-ai[bot] in #50 (comment)