[REV-1205] Add ecommerce event tracking to FBE (feature based enrollment) upsell links (#24528)

This commit is contained in:
Diane Kaplan
2020-07-23 11:40:22 -04:00
committed by GitHub
parent a7f6879ebd
commit 0b2a9c7010
6 changed files with 46 additions and 2 deletions

View File

@@ -440,7 +440,7 @@ def get_expiration_banner_text(user, course, language='en'):
bannerText = u'<strong>Audit Access Expires {expiration_date}</strong><br>\
You lose all access to this course, including your progress, on {expiration_date}.\
<br>Upgrade by {upgrade_deadline} to get unlimited access to the course as long as it exists\
on the site. <a href="{upgrade_link}">Upgrade now<span class="sr-only"> to retain access past\
on the site. <a id="FBE_banner" href="{upgrade_link}">Upgrade now<span class="sr-only"> to retain access past\
{expiration_date}</span></a>'.format(
expiration_date=formatted_expiration_date,
upgrade_link=upgrade_link,

View File

@@ -64,3 +64,15 @@ from openedx.core.djangolib.markup import HTML
<%include file="_underscore_templates.html" />
<%include file="_thread_list_template.html" />
<%static:require_module_async module_name="js/commerce/track_ecommerce_events" class_name="TrackECommerceEvents">
var fbeLink = $("#FBE_banner");
TrackECommerceEvents.trackUpsellClick(fbeLink, 'discussion_audit_access_expires', {
pageName: "discussion_tab",
linkType: "link",
linkCategory: "FBE_banner"
});
</%static:require_module_async>

View File

@@ -271,3 +271,15 @@ ${HTML(fragment.foot_html())}
% endif
</nav>
% endif
<%static:require_module_async module_name="js/commerce/track_ecommerce_events" class_name="TrackECommerceEvents">
var fbeLink = $("#FBE_banner");
TrackECommerceEvents.trackUpsellClick(fbeLink, 'in_course_audit_access_expires', {
pageName: "in_course",
linkType: "link",
linkCategory: "FBE_banner"
});
</%static:require_module_async>

View File

@@ -248,3 +248,15 @@ username = get_enterprise_learner_generic_name(request) or student.username
<%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory">
DateUtilFactory.transform(iterationKey=".localized-datetime");
</%static:require_module_async>
<%static:require_module_async module_name="js/commerce/track_ecommerce_events" class_name="TrackECommerceEvents">
var fbeLink = $("#FBE_banner");
TrackECommerceEvents.trackUpsellClick(fbeLink, 'progress_audit_access_expires', {
pageName: "progress_tab",
linkType: "link",
linkCategory: "FBE_banner"
});
</%static:require_module_async>

View File

@@ -179,7 +179,7 @@ def generate_course_expired_message(user, course):
)
return HTML(full_message).format(
a_open=HTML(u'<a href="{upgrade_link}">').format(
a_open=HTML(u'<a id="FBE_banner" href="{upgrade_link}">').format(
upgrade_link=verified_upgrade_deadline_link(user=user, course=course)
),
sronly_span_open=HTML('<span class="sr-only">'),

View File

@@ -193,6 +193,7 @@ from openedx.features.course_experience.course_tools import HttpMethod
<%static:require_module_async module_name="js/commerce/track_ecommerce_events" class_name="TrackECommerceEvents">
var personalizedLearnerSchedulesLink = $(".personalized_learner_schedules_button");
var fbeLink = $("#FBE_banner");
TrackECommerceEvents.trackUpsellClick(personalizedLearnerSchedulesLink, 'course_home_upgrade_shift_dates', {
pageName: "course_home",
@@ -200,4 +201,11 @@ from openedx.features.course_experience.course_tools import HttpMethod
linkCategory: "personalized_learner_schedules"
});
TrackECommerceEvents.trackUpsellClick(fbeLink, 'course_home_audit_access_expires', {
pageName: "course_home",
linkType: "link",
linkCategory: "FBE_banner"
});
</%static:require_module_async>