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

Analytics for quick edit modals, relative to legacy edit modal #4696

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

bjester
Copy link
Member

@bjester bjester commented Aug 30, 2024

Summary

Description of the change(s) you made

  • Adds analytics event tracking to quick edit modals
  • Adds analytics event tracking to legacy edit modal

Manual verification steps performed

  1. Use quick edit modals
  2. Confirm the analytics data in the console-- that it's accurate and representative of the changes
  3. Use legacy edit modal
  4. Confirm the analytics data in the console-- that it's accurate and representative of the changes

Reviewer guidance

How can a reviewer test these changes?

Are there any risky areas that deserve extra testing?

References

Events and data should support the desired tracking defined in Confirm the analytics data in the console-- that it's accurate and representative of the changes

Notion doc for reference: https://www.notion.so/learningequality/Use-Studio-tag-manager-to-track-the-bulk-editing-feature-update-a225bb594ddf4571aa02d4ad349a92be?pvs=4

Comments


Contributor's Checklist

PR process:

  • If this is an important user-facing change, PR or related issue the CHANGELOG label been added to this PR. Note: items with this label will be added to the CHANGELOG at a later time
  • If this includes an internal dependency change, a link to the diff is provided
  • The docs label has been added if this introduces a change that needs to be updated in the user docs?
  • If any Python requirements have changed, the updated requirements.txt files also included in this PR
  • Opportunities for using Google Analytics here are noted
  • Migrations are safe for a large db

Studio-specifc:

  • All user-facing strings are translated properly
  • The notranslate class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)
  • All UI components are LTR and RTL compliant
  • Views are organized into pages, components, and layouts directories as described in the docs
  • Users' storage used is recalculated properly on any changes to main tree files
  • If there new ways this uses user data that needs to be factored into our Privacy Policy, it has been noted.

Testing:

  • Code is clean and well-commented
  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Any new interactions have been added to the QA Sheet
  • Critical and brittle code paths are covered by unit tests

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Hi @bjester - this looks so great, thank you for working on it. Overall this seems to be working as expected with the manual QA that I've done. I noticed a couple of non-blocking potential improvements to make things more clear to analyze that we can decide whether or not we want to update now, or if we want to do this in a patch release.

The first is that in the legacy edit modal, I think due to the autofocus in the title, there is a tracked click event every time the modal opens, which Sairina introduced a couple of years ago. I don't think this necessarily has to change, and it has a different event name, but it might just be something worth making note of if/when we do analytics so that we are not counting each of those as an intentional title edit.

My other question is whether or not the "specific" changed details would be useful to have in the legacy modal more comprehensively, or if it's better on the analytics side to draw on the existing data and merge the two sources of info for analysis. (And, this really isn't a code implementation question, it's an analytics question that I just don't know the answer to).

For example, with the quick edit modals, we can see this in the console:
Screenshot 2024-09-03 at 11 43 25 AM

which to me is very clear. But also, the modals are narrowly scoped in terms of what's happening :)

The legacy edit modal has events that track both of this, but they're split up, a bit, with both the new additions you've made, plus the existing analytics.

Screenshot 2024-09-03 at 11 43 59 AM

Do you think on the google analytics side we'll be able to do comparisons like this, or is having more "detail" in the updates that you added useful?

Definitely not a blocker, just a curiosity as it's been a really long time since I've done anything GA and that was mostly in terms of email and social media link click through stuff.

@bjester
Copy link
Member Author

bjester commented Sep 3, 2024

@marcellamaki I thought I had attached the notion document to the PR description, but it seems I didn't-- here it is. There's only one signal related to tracking the legacy types of editing, and I didn't attempt to track it because for legacy edits we'd need to report on it at the user level, based off how the tracking works. So without a split test, I don't know that we can get usable data for direct comparisons between the two for different types fields / edits the user makes in each.

For the quick edit modals, it makes sense to differentiate between individual edit events because they're different modals, those signals are requested, and it doesn't hurt to track that. With the legacy edit modal, they can really change anything, so if our primary signal is in time spent curating, the legacy modal could very well out perform the quick edits because a user can change multiple things at once.

@marcellamaki
Copy link
Member

Ah this Notion doc is great!! Thank you! Answers my questions (and so many more I didn't know I had). Very cool. Okay, well I don't have any blocking concerns on this. Not sure if @AlexVelezLl or @rtibbles want to weigh in on anything? If not, I'll go ahead and approve.

@bjester
Copy link
Member Author

bjester commented Sep 3, 2024

@marcellamaki we can also leverage the prior existing events for reporting on this feature. Most of this work just makes it easier to set things up in GTM for tracking, which Jessica, Tomiwa and I found out in our last meeting when we tried to attach click events to the modals 😅

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

Thank you @blaine! I just saw that there are differences in what we consider as changed across the Quick Edit Modals. For example in modals like the boolean maps (categories, learning activities, levels, resources needed), the completion and the source we consider changed = true if the user interacted with the form in the modal, as we set watchers that set the changed value if we ever changed anything, but it doesnt take into acount if we reverted the change in a later state. Meanwhile in modals like the audience, the language, the Title and Description we consider changed = true if the current state on save is different from the initial state of the node before persisting the changes.

For example if we do something like this in the edit audience modal:

Initial state: Author = "Author 1"
Change 1: Author = "Author 2"
Change 2: Author = "Author 1"

We will mark this as changed: true.

But if we do something like this in the edit title and description modal:

Initial state: Title = "Node 1"
Change 1: Title = "Node 2"
Change 2: Title = "Node 1"

We will mark this as changed: false.

Compartir.pantalla.-.2024-09-03.14_10_56.mp4

Im not sure which should be the correct behaviour, If changed means that we interacted with the form, or if it means that the state was changed comparing to the initial state. But I think this should be consistent in all quick edit modals.

Apart from that, everything else looks good to me :)

@marcellamaki
Copy link
Member

Oo that's a good edge case/clarification, @AlexVelezLl! thanks for noticing that.

@bjester
Copy link
Member Author

bjester commented Sep 3, 2024

@AlexVelezLl you're right, I did this quickly and mixed the two. we only really care that an interaction occurred, so just the ones comparing with initial state need to be fixed, and those are probably less likely to return to their original state if the user edited them

@AlexVelezLl
Copy link
Member

Oh, If we are ok with that behaviour its ok on my side 😅. Would be worth opening a follow up or informing somewhere in the code that this difference in tracking the changes is on purpose

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

Lgtm! 🤗

@bjester bjester merged commit 9c1ec32 into learningequality:unstable Sep 4, 2024
13 checks passed
@akolson akolson mentioned this pull request Sep 13, 2024
@akolson akolson mentioned this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants