Skip to content
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

Introduce experimental UI Events #1899

Closed
wants to merge 29 commits into from
Closed

Introduce experimental UI Events #1899

wants to merge 29 commits into from

Conversation

rdig
Copy link
Member

@rdig rdig commented Feb 14, 2024

--------------------------------------------------------- DRAFT ------------------

‎ ‎ ‎

Brief

The aim of this feature is offer marketing and growth personnel the ability to glimpse into the patterns and behaviors of the CDapp users and gain insight into the way they are actually using the application, and to use that gained knowledge to drive better informed feature development.

In order to achieve that we decided on the use of a data warehousing service, Segment in this case.

Within the CDapp we introduced the notion of "UI Events" by which we mean events, emitted by users in the context of the UI of the CDapp. Basically clicks, menus, dropdowns, various action triggers, success states.

Since we don't store (or ar making strides toward not storing) API or secret keys on the client we make use of the colonyCDappAuthProxy to act as a man-in-the-middle for our various requests to the Segment service.

Architecture

Architecture setup for this implementation is quite strait forward, the CDapp, upon emitting a new UI event will POST the event's payload to the auth proxy, which will in turn forward said payload Segment's endpoint.

Due to it's double blind nature, a 200 status code will always be received by the client, even if Segment's endpoint is down, or has trouble processing the request.

Before any UI events can emitted though, the UIEvents class instance needs to be initialized (loaded), by which we mean, it needs to make an initial request to Segment's services (which is still proxied via the auth proxy, were we tack on the correct project id) and use the response data to set up the instance.

Screenshot from 2024-02-15 19-57-37

UI Events and React Component Triggers

TBA

Event Type Description
user Identify a specific user (or anonymous), after wallet connected
colony Identify a specific colony and group the individual user to it
emit Triggered for various user interactable actions (clicks, menus, etc)
uiEvents.emit(eventName: string, eventProps: Record<string, any>);
uiEvents.user(userId: string, eventProps: Record<string, any>);
uiEvents.colony(colonyId: string, eventProps: Record<string, any>);
Event Name Description
manageAccount User Managed Account
createAccount User Created Account
updateAvatar User Updated Avatar
updateProfile User Updated Profile
userJoinedColony User Joined Colony
colonySwitcher User Opened Colony Switcher
viewPage User Viewed Page (Generic event, props describe which page)
openMenu User Opened Menu (Generic event, props describe which menu)
relatedAction User Clicked Related Action
giveFeedback User Gave Feedback
openTeamsMenu User Opened Teams Menu
selectTeam User Selected Team ((Props describe which team)
actionSidebarOpened User Opened Action Sidebar
actionCreated User Created Action (Generic event, props describe which action)
actionCreationSucceeded User Action Creation Succeeded

Further reading:

Requests proxying and forwarding

TBA

Proxy Endpoint Wildcard Description
/ui-events/v1/projects/* Get the specific Segment project init settings using the write key
/ui-events/v1/* Called when sending the specific event types

JoinColony/colonyCDappAuthProxy#12

Google Tag Manager

TBA

Testing

TBA

Screenshot from 2024-02-15 17-56-32
Screenshot from 2024-02-15 18-04-40

Miscellaneous

TBA

@rdig rdig self-assigned this Feb 14, 2024
@rdig rdig added the enhancement New feature or request label Feb 14, 2024
src/Entry.tsx Outdated Show resolved Hide resolved
@rdig rdig force-pushed the experimental/ui-events branch from d952acf to 3a2c8c3 Compare February 15, 2024 15:54
@rdig rdig changed the title Introduce experimental UI Events Introduce ~~experimental~~ UI Events Feb 15, 2024
@rdig rdig changed the title Introduce ~~experimental~~ UI Events Introduce experimental UI Events Feb 15, 2024
@rdig rdig added the on-hold label Feb 26, 2024
@rdig
Copy link
Member Author

rdig commented Mar 11, 2024

As an update to what's going on here, we're waiting for a decision regarding which consent manager plugin / library / service to use

@rdig
Copy link
Member Author

rdig commented Jul 16, 2024

Closing as we used a different direction on how we handle user traces, hence the work here is no longer relevant.

However the concepts here still apply and might be salvaged later down the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request on-hold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant