Skip to content

Conversation

@jkachel
Copy link
Contributor

@jkachel jkachel commented Oct 18, 2024

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/5817

Description (What does it do?)

This is a pretty simple PR. It just moves the calls to captureSearchEvent after the relevant calls to adjust search parameters, so we get the resulting search_update event in PostHog after the change has been made.

How can this be tested?

A PostHog account is needed for testing.

  1. In PostHog, go to Activity, then filter it in such a way that you're easily able to see your own events. (IP address is recorded so that's probably the easiest way.) Ideally, also adjust the columns to show some of the search_param_ properties and limit your facet selections to those so it's easier to identify what's changing.
  2. Open Learn in a new tab, then search for something, then change some of the parameters. (If you've adjusted the columns in step 1, limit your changes to those facet types.) Try to get to a point where you have at least one resource returned.
  3. Open the drawer for one of the search results.
  4. View the events that were triggered in PostHog. There will be some delay before it processes the events but they should show up after ~one minute.

Your search_update events should include the updated selections. Prior to this, they would not - it'd capture your state before you made changes.

@jkachel jkachel added Needs Review An open Pull Request that is ready for review product:mit-open Issues related to the MIT Open product labels Oct 18, 2024
@ChristopherChudzicki ChristopherChudzicki self-assigned this Oct 18, 2024
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki left a comment

Choose a reason for hiding this comment

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

Clicking facets shows me:

Screenshot 2024-10-18 at 1 22 23 PM

I search search_update. Are the other 3 events default posthog events?

@jkachel
Copy link
Contributor Author

jkachel commented Oct 18, 2024

Clicking facets shows me:
Screenshot 2024-10-18 at 1 22 23 PM

I search search_update. Are the other 3 events default posthog events?

Yes - those are autocapture events. We get those by default.

@jkachel jkachel merged commit 74d9f9e into main Oct 18, 2024
11 checks passed
This was referenced Oct 21, 2024
@rhysyngsun rhysyngsun deleted the jkachel/5817-adjust-search-update-event-tracking branch February 7, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review product:mit-open Issues related to the MIT Open product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants