Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Conversation

@alaisgomes
Copy link
Contributor

Ticket

PLAT-13612
Related PRs: https://github.com/crowdbotics/vue-dash-5104/pull/4663

Type of PR

  • Bugfix
  • New feature
  • Minor changes

Did you make changes to modules or create a new module?

Changes introduced

Updated amplitude tracking to respect the send the same properties as the Vue dashboard. The following events are being tracked:

  • List Modules
  • Publish Modules
  • View Module Details
  • Create Module
  • Archive Module
  • Unarchive Module
  • Upgrade Scaffold

Notes:

  • we don't have any app-specific actions in the CLI, so app-related properties were skipped
  • Although I introduced the concept of currentUser global object, I did not replace other get /user/ API calls with this global object yet (I wanted to keep the changes scoped to amplitude-related code only)

Test and review

Test and see if the events mentioned above are being sent to Amplitude.

robester0403
robester0403 previously approved these changes Feb 5, 2024
Copy link
Contributor

@robester0403 robester0403 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with small optional comments


class AmplitudeWrapper {
get userType() {
// TODO: Implement once we have the data available in the UserSerializer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just doubling checking that there's a ticket for this further down the road.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's one yet, but this was defined as a mandatory property in the spreadsheet, so I added this to not forget. I will ask Bryan, probably should create the ticket now


const identifyEvent = new Identify();
identifyEvent.set("Django Id", currentUser.get("id"));
identify(identifyEvent, { user_id: currentUser.get("email") });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure but are we guaranteed to get an email from the user response? otherwise ignore this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user object is returned, then that's a guarantee, since it is a required field. But I think to safeguard, I should probably change if (!currentUser.get("id")) return; to if (!currentUser.get("email")) return;, since email is more important than id for amplitude.

I'll change it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in cd145da

@alaisgomes alaisgomes marked this pull request as ready for review February 5, 2024 17:45
@alaisgomes alaisgomes merged commit 4613abc into develop Feb 7, 2024
@alaisgomes alaisgomes deleted the PLAT-13612 branch February 7, 2024 15:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants