From 7a58e05df437f818c5cc5ce302cb72d2bbda8c34 Mon Sep 17 00:00:00 2001 From: muhammadali124 <109604645+muhammadali124@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:37:33 +0500 Subject: [PATCH] added clarity in studio (#516) --- cms/envs/common.py | 3 +++ cms/envs/production.py | 6 ++++++ .../js/features_jsx/studio/CourseOrLibraryListing.jsx | 1 + cms/templates/index.html | 9 ++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 0f46df8a43d0..ade11ab4f5f5 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -2476,3 +2476,6 @@ # OPEN AI API KEY OPENAI_SECRET_KEY = 'set-secret-key' + +# MS CLARITY PROJECT ID +CLARITY_PROJECT_ID = 'replace-me' diff --git a/cms/envs/production.py b/cms/envs/production.py index 1c7fdece490b..4a9ab223fe2e 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -600,3 +600,9 @@ def get_env_setting(setting): 'USETIFUL_PROJECT_TOKEN', None ) + +# MS CLARITY PROJECT ID +CLARITY_PROJECT_ID = ENV_TOKENS.get( + 'CLARITY_PROJECT_ID', + CLARITY_PROJECT_ID +) diff --git a/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx b/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx index 39572ff47048..2fc38c9ddb99 100644 --- a/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx +++ b/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx @@ -36,6 +36,7 @@ export function CourseOrLibraryListing(props) { }, body: JSON.stringify(requestData), }); + clarity('set', 'has_viewed_course', 'true'); }; return ( diff --git a/cms/templates/index.html b/cms/templates/index.html index 0b51d532a033..0042261eafac 100644 --- a/cms/templates/index.html +++ b/cms/templates/index.html @@ -132,7 +132,7 @@

${_("Create a New Course")}

'screen_name': 'studio_home', 'organization': '${platform_name}', } - ); sendTracking({'has_created_course':'true'}); CourseLimitRedirect();" + ); sendTracking({'has_created_course':'true'}); CourseLimitRedirect(); clarity('set', 'has_created_course', 'true');" /> @@ -611,6 +611,13 @@

${_('Need help?')}