Skip to content
Snippets Groups Projects
Unverified Commit 0b2a9c70 authored by Diane Kaplan's avatar Diane Kaplan Committed by GitHub
Browse files

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

parent a7f6879e
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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>
......@@ -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>
\ No newline at end of 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>
......@@ -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">'),
......
......@@ -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>
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