From 67a33d47e1abe4ccfffd8b449dbffd668e7a2e7d Mon Sep 17 00:00:00 2001 From: Ken Clary Date: Fri, 30 Jul 2021 10:23:23 -0400 Subject: [PATCH] feat: add explicit courserun_key parameter to /event endpoint We add 'courserun_key' (aka "course_id" though that's technically a misnomer) as an optional parameter to the /event endpoint url. If it is not present, it will still be parsed out of the url, if the url is of the right format. Additionally, Logger.log() in js adds this parameter to its /event call, pulling it from the $$course_id global. This provides opportunity for MFEs to (separately) provide the key without concern about url parsing. TNL-7752 --- common/static/js/spec/logger_spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/static/js/spec/logger_spec.js b/common/static/js/spec/logger_spec.js index 2939420465..03c0ed18e5 100644 --- a/common/static/js/spec/logger_spec.js +++ b/common/static/js/spec/logger_spec.js @@ -17,6 +17,7 @@ data: { event_type: 'example', event: '"data"', + courserun_key: 'edx/999/test', page: window.location.href }, async: true @@ -32,6 +33,7 @@ data: { event_type: 'example', event: '"data"', + courserun_key: 'edx/999/test', page: window.location.href }, async: false @@ -66,6 +68,7 @@ data: { event_type: 'example', event: '"data"', + courserun_key: 'edx/999/test', page: window.location.href }, async: true @@ -83,6 +86,7 @@ data: { event_type: 'example', event: '"data"', + courserun_key: 'edx/999/test', page: window.location.href }, async: true @@ -100,6 +104,7 @@ data: { event_type: 'example', event: '"data"', + courserun_key: 'edx/999/test', page: window.location.href }, async: true @@ -183,6 +188,7 @@ data: { event_type: 'page_close', event: '', + courserun_key: 'edx/999/test', page: window.location.href }, async: false