Add analytics tracking to Discover New header link. (#20896)

This commit is contained in:
Douglas Hall
2019-06-25 16:36:59 -04:00
committed by GitHub
parent 52a5c81589
commit 0f045ab5db
3 changed files with 7 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ var edx = edx || {};
// Emit an event when the 'Find Courses' button is clicked.
edx.dashboard.trackFindCourseBtnClicked = function($findCoursesBtn, properties) {
var trackProperty = properties || {category: 'dashboard', label: null};
var trackProperty = properties || {category: 'dashboard', label: 'sidebar'};
window.analytics.trackLink(
$findCoursesBtn,
'edx.bi.dashboard.find_courses_button.clicked',
@@ -91,5 +91,9 @@ var edx = edx || {};
edx.dashboard.trackCourseOptionDropdownClicked($('.wrapper-action-more'));
edx.dashboard.trackLearnVerifiedLinkClicked($('.verified-info'));
edx.dashboard.trackFindCourseBtnClicked($('.btn-find-courses'));
edx.dashboard.trackFindCourseBtnClicked(
$('.discover-new-link'),
{category: 'dashboard', label: 'header'}
);
});
}(jQuery));

View File

@@ -54,7 +54,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_
% endif
% if show_explore_courses:
<div class="mobile-nav-item hidden-mobile nav-item nav-tab">
<a class="tab-nav-link" href="${marketing_link('COURSES')}"
<a class="tab-nav-link discover-new-link" href="${marketing_link('COURSES')}"
aria-current="${'page' if '/courses' in request.path else 'false'}">
${_('Discover New')}
</a>

View File

@@ -55,7 +55,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_
% endif
% if show_explore_courses:
<div class="mobile-nav-item hidden-mobile nav-item nav-tab">
<a class="tab-nav-link" href="${marketing_link('COURSES')}"
<a class="tab-nav-link discover-new-link" href="${marketing_link('COURSES')}"
aria-current="${'page' if '/courses' in request.path else 'false'}">
${_('Discover New')}
</a>