feat: credit banner (#96)
This commit is contained in:
@@ -5,6 +5,7 @@ export const categories = StrictDict({
|
||||
upgrade: 'upgrade',
|
||||
userEngagement: 'user-engagement',
|
||||
searchButton: 'search_button',
|
||||
credit: 'credit',
|
||||
});
|
||||
|
||||
export const events = StrictDict({
|
||||
@@ -48,6 +49,7 @@ export const eventNames = StrictDict({
|
||||
enterpriseDashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`,
|
||||
enterpriseDashboardModalClosed: `${learnerPortal}.closed`,
|
||||
findCoursesClicked: 'edx.bi.dashboard.find_courses_button.clicked',
|
||||
purchaseCredit: 'edx.bi.credit.clicked_purchase_credit',
|
||||
});
|
||||
|
||||
export const linkNames = StrictDict({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import course from './trackers/course';
|
||||
import credit from './trackers/credit';
|
||||
import engagement from './trackers/engagement';
|
||||
import enterpriseDashboard from './trackers/enterpriseDashboard';
|
||||
import entitlements from './trackers/entitlements';
|
||||
@@ -7,6 +8,7 @@ import findCourses from './trackers/findCourses';
|
||||
|
||||
export default {
|
||||
course,
|
||||
credit,
|
||||
engagement,
|
||||
enterpriseDashboard,
|
||||
entitlements,
|
||||
|
||||
19
src/tracking/trackers/credit.js
Normal file
19
src/tracking/trackers/credit.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createEventTracker, createLinkTracker } from 'data/services/segment/utils';
|
||||
import { categories, eventNames } from '../constants';
|
||||
|
||||
/**
|
||||
* Create event tracker for purchase credit event
|
||||
* @param {string} fromCourseRun - course run identifier for leaving course
|
||||
* @return {callback} - callback that triggers the event tracker
|
||||
*/
|
||||
export const purchase = (courseKey, href) => createLinkTracker(
|
||||
createEventTracker(eventNames.purchaseCredit, {
|
||||
label: courseKey,
|
||||
category: categories.credit,
|
||||
}),
|
||||
href,
|
||||
);
|
||||
|
||||
export default {
|
||||
purchase,
|
||||
};
|
||||
Reference in New Issue
Block a user