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

feat: tidy some context on replay events #28306

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Feb 4, 2025

we talked about adding context to our recording viewed and analyzed events so we can track useful things like "are people watching more from playlists"

these are backend events

we capture current URL on these but since they can contain different IDs breakdown by them is yucky

let's do some simple cleaning as we capture these events (since a hogql multistep regex replace is messy to maintain)

i got to here with regex in hogql

2025-02-04 22 19 06

and i didn't want to maintain that

@pauldambra pauldambra requested a review from veryayskiy February 4, 2025 22:19
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds URL path cleaning functionality to standardize session recording event analytics, particularly for tracking recording views from different sources like playlists.

  • Added clean_referer_url function in /posthog/session_recordings/session_recording_api.py to standardize URLs into categories like 'person-page', 'insight', 'replay-direct'
  • Added comprehensive test suite in /posthog/session_recordings/test/test_clean_referer_url.py with parameterized test cases covering various URL patterns
  • Added cleaned_replay_path to event properties in SessionRecordingViewSet.update() for better analytics breakdowns
  • Implemented error handling with posthoganalytics.capture_exception for URL cleaning failures

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Size Change: +5 B (0%)

Total Size: 1.17 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.17 MB +5 B (0%)

compressed-size-action

@veryayskiy
Copy link
Contributor

And I have an addition to you for that - see last two pictures here: #28211

@pauldambra pauldambra enabled auto-merge (squash) February 5, 2025 09:59
@pauldambra pauldambra merged commit 9ffb373 into master Feb 5, 2025
103 checks passed
@pauldambra pauldambra deleted the feat/clean-path-for-recording-events branch February 5, 2025 11:11
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.

2 participants