Skip to content

Add extra required data to the track_event call when creating a school#899

Draft
jamiebenstead wants to merge 1 commit into
mainfrom
1485-add-extra-data-to-school-created-event-tracking
Draft

Add extra required data to the track_event call when creating a school#899
jamiebenstead wants to merge 1 commit into
mainfrom
1485-add-extra-data-to-school-created-event-tracking

Conversation

@jamiebenstead

Copy link
Copy Markdown
Contributor

Status

Description of what's been done

  • Add first_landing_page and marketing_preference data when saving the School - Created event

@cla-bot cla-bot Bot added the cla-signed label Jun 26, 2026
@github-actions

Copy link
Copy Markdown

Test coverage

91.97% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/28237060483

'School - Created',
school_id: @school.id,
first_landing_page: params[:first_landing_page],
marketing_parameters: marketing_parameters

@zetter-rpf zetter-rpf Jun 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm wondering if it would be easier to query in the data warehouse if all of the event properties were at the same level. It might just be harder to document and query if some are nested inside other attributes. This means we could query on events.properties['utm_source'] rather than events.properties['marketing_params']['utm_source'].

You should be able to do this by spatting the marketing parameters:

track_event('School - Created', **marketing_parameters, @school.id:, first_landing_page: params[:first_landing_page])

@zetter-rpf zetter-rpf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great. added a suggestion - let me know if you think it's worth doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants