feat: add UTM parameter data to insights bookings CSV download#27854
Merged
anikdhabal merged 3 commits intomainfrom Feb 11, 2026
Merged
feat: add UTM parameter data to insights bookings CSV download#27854anikdhabal merged 3 commits intomainfrom
anikdhabal merged 3 commits intomainfrom
Conversation
Co-Authored-By: carina@cal.com <c.wollendorfer@me.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: carina@cal.com <c.wollendorfer@me.com>
…king Co-Authored-By: carina@cal.com <c.wollendorfer@me.com>
eunjae-lee
approved these changes
Feb 11, 2026
Contributor
eunjae-lee
left a comment
There was a problem hiding this comment.
the code change looks good !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds UTM parameter data (
utm_source,utm_medium,utm_campaign,utm_term,utm_content) to the CSV download from/insightsbookings, matching the format already used in the/insights/routingCSV download.Previously, the bookings CSV export did not include any UTM tracking data. UTM data is stored on the
Trackingmodel (one-to-one relation withBookingvia@@unique([bookingId])). The routing form responses CSV already includes UTM columns (seerouting-events.tslines 191-195), so this change brings parity.Changes:
BookingWithAttendeestype to include thetrackingrelation (nullable, since not all bookings have tracking data)trackingrelation with UTM fields to the PrismaselectingetCsvDatagetUtmDataForBookinghelper to extract UTM data viabooking.tracking, with empty-string defaults for null values (matching routing CSV behavior)getUtmDataForBookingand UTM inclusion intransformBookingsForCsv, updated existing test fixtures and snapshotsMandatory Tasks (DO NOT REMOVE)
How should this be tested?
?utm_source=test&utm_medium=emailetc.)/insights, select a date range covering those bookingsutm_source,utm_medium,utm_campaign,utm_term,utm_contentcolumns are present with correct values/insights/routingto verify the format matchesHuman Review Checklist
trackingrelation JOIN ingetCsvDatadoesn't significantly impact query performance for large exportsbookingsByUidMap construction intransformBookingsForCsvis acceptable (iterates bookings array once more per batch of up to 100)