[REV-1257] Add upsell tracking for upgrading all programs button on program dashboard (#24589)

Added upsell tracking to the course upgrade all button on the program dashboard so we have a better understanding of when users are clicking our upsell links.
This commit is contained in:
JJ
2020-07-27 09:21:46 -04:00
committed by GitHub
parent 684230463a
commit b77d4c9490
2 changed files with 9 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import HeaderView from './program_header_view';
import SidebarView from './program_details_sidebar_view';
import pageTpl from '../../../templates/learner_dashboard/program_details_view.underscore';
import trackECommerceEvents from '../../commerce/track_ecommerce_events';
class ProgramDetailsView extends Backbone.View {
constructor(options) {
@@ -43,6 +44,13 @@ class ProgramDetailsView extends Backbone.View {
);
this.render();
const $courseUpsellButton = $('#program_dashboard_course_upsell_all_button');
trackECommerceEvents.trackUpsellClick($courseUpsellButton, 'program_dashboard_program', {
linkType: 'button',
pageName: 'program_dashboard',
linkCategory: 'green_upgrade',
});
}
static getUrl(base, programData) {

View File

@@ -22,7 +22,7 @@
</div>
<% } %>
<% if (is_learner_eligible_for_one_click_purchase && (typeof is_mobile_only === 'undefined' || is_mobile_only === false)) { %>
<a href="<%- completeProgramURL %>" class="btn-brand btn cta-primary upgrade-button complete-program">
<a href="<%- completeProgramURL %>" class="btn-brand btn cta-primary upgrade-button complete-program" id="program_dashboard_course_upsell_all_button">
<%- gettext('Upgrade All Remaining Courses (')%>
<% if (discount_data.is_discounted) { %>
<span class='list-price'>