Skip to content
Snippets Groups Projects
Unverified Commit b77d4c94 authored by JJ's avatar JJ Committed by GitHub
Browse files

[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.
parent 68423046
No related branches found
Tags release-2021-07-13-13.00
No related merge requests found
......@@ -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) {
......
......@@ -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'>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment