From 39ad9c51e1c19cabdb59aab85279d3f7caa5c67b Mon Sep 17 00:00:00 2001 From: Jamie Benstead Date: Thu, 25 Jun 2026 14:51:00 +0100 Subject: [PATCH] Add extra required data to the track_event call when creating a school --- app/controllers/api/schools_controller.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/schools_controller.rb b/app/controllers/api/schools_controller.rb index 9bc829bb8..f4029f4ff 100644 --- a/app/controllers/api/schools_controller.rb +++ b/app/controllers/api/schools_controller.rb @@ -20,7 +20,12 @@ def create if result.success? @school = result[:school] - track_event('School - Created', school_id: @school.id) + track_event( + 'School - Created', + school_id: @school.id, + first_landing_page: params[:first_landing_page], + marketing_parameters: marketing_parameters + ) render :show, formats: [:json], status: :created else render json: { @@ -77,6 +82,10 @@ def import private + def marketing_parameters + params[:marketing_parameters]&.permit!&.to_h + end + def create_params params.expect( school: %i[name