diff --git a/openedx/features/course_bookmarks/plugins.py b/openedx/features/course_bookmarks/plugins.py index 95e73f0af8..bb8921823c 100644 --- a/openedx/features/course_bookmarks/plugins.py +++ b/openedx/features/course_bookmarks/plugins.py @@ -13,6 +13,13 @@ class CourseBookmarksTool(CourseTool): """ The course bookmarks tool. """ + @classmethod + def analytics_id(cls): + """ + Returns an id to uniquely identify this tool in analytics events. + """ + return 'edx.bookmarks' + @classmethod def is_enabled(cls, request, course_key): """ diff --git a/openedx/features/course_experience/course_tools.py b/openedx/features/course_experience/course_tools.py index 82fe4be708..3be140ecc3 100644 --- a/openedx/features/course_experience/course_tools.py +++ b/openedx/features/course_experience/course_tools.py @@ -16,6 +16,14 @@ class CourseTool(object): not a requirement, and plugin implementations outside of this repo should simply follow the contract defined below. """ + @classmethod + def analytics_id(cls): + """ + Returns an id to uniquely identify this tool in analytics events. + + For example, 'edx.bookmarks'. New tools may warrant doc updates for the new id. + """ + raise NotImplementedError("Must specify an id to enable course tool eventing.") @classmethod def is_enabled(cls, request, course_key): diff --git a/openedx/features/course_experience/plugins.py b/openedx/features/course_experience/plugins.py index e2aa0fe2bf..a47cf7eb4d 100644 --- a/openedx/features/course_experience/plugins.py +++ b/openedx/features/course_experience/plugins.py @@ -19,6 +19,13 @@ class CourseUpdatesTool(CourseTool): """ The course updates tool. """ + @classmethod + def analytics_id(cls): + """ + Returns an analytics id for this tool, used for eventing. + """ + return 'edx.updates' + @classmethod def title(cls): """ @@ -57,6 +64,13 @@ class CourseReviewsTool(CourseTool): """ The course reviews tool. """ + @classmethod + def analytics_id(cls): + """ + Returns an id to uniquely identify this tool in analytics events. + """ + return 'edx.reviews' + @classmethod def title(cls): """ diff --git a/openedx/features/course_experience/static/course_experience/fixtures/course-home-fragment.html b/openedx/features/course_experience/static/course_experience/fixtures/course-home-fragment.html index 42fdd71c75..f4a255ec87 100644 --- a/openedx/features/course_experience/static/course_experience/fixtures/course-home-fragment.html +++ b/openedx/features/course_experience/static/course_experience/fixtures/course-home-fragment.html @@ -67,19 +67,19 @@

Course Tools