Skip to content

Commit

Permalink
feat: Add Cohesion stage keys and remove taggy (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk authored Nov 8, 2024
1 parent bb635ae commit 963501c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ NEW_RELIC_LICENSE_KEY=null
ORDER_HISTORY_URL=null
REFRESH_ACCESS_TOKEN_ENDPOINT=null
SEGMENT_KEY=null
COHESION_TAGULAR_WRITE_KEY=null
COHESION_TAGULAR_SOURCE_KEY=null
SITE_NAME=null
USER_INFO_COOKIE_NAME=null
USER_LOCATION_COOKIE_NAME=null
Expand Down
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ MARKETING_SITE_BASE_URL='http://localhost:18000'
ORDER_HISTORY_URL=http://localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
SEGMENT_KEY='VMsX2obE9Xveo4se3c6CmfdG0LZVc7qI'
COHESION_TAGULAR_WRITE_KEY='wk_2nkzqlbOsxrS0UwzagXrVuHqQyy'
COHESION_TAGULAR_SOURCE_KEY='src_2nkzqlaM9p3iziS4RHRHuRecrX8'
SITE_NAME='edX'
USER_INFO_COOKIE_NAME='edx-user-info'
USER_LOCATION_COOKIE_NAME='prod-edx-cf-loc'
Expand Down
2 changes: 2 additions & 0 deletions .env.development-stage
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ MARKETING_SITE_BASE_URL='/proxy/lms'
ORDER_HISTORY_URL=http://localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT='/proxy/lms/login_refresh'
SEGMENT_KEY=null
COHESION_TAGULAR_WRITE_KEY='wk_2nkzqlbOsxrS0UwzagXrVuHqQyy'
COHESION_TAGULAR_SOURCE_KEY='src_2nkzqlaM9p3iziS4RHRHuRecrX8'
SITE_NAME='edX'
USER_INFO_COOKIE_NAME='npmstage-edx-user-info'
USER_LOCATION_COOKIE_NAME='prod-edx-cf-loc'
Expand Down
2 changes: 2 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ MARKETING_SITE_BASE_URL='http://localhost:18000'
ORDER_HISTORY_URL=http://localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
SEGMENT_KEY=null
COHESION_TAGULAR_WRITE_KEY=null
COHESION_TAGULAR_SOURCE_KEY=null
SITE_NAME='edX'
USER_INFO_COOKIE_NAME='edx-user-info'
USER_LOCATION_COOKIE_NAME='prod-edx-cf-loc'
Expand Down
4 changes: 2 additions & 2 deletions cohesion.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const cohesionConfig = {
defaultCategory: '',
defaultSubject: '',
tagularApiKey: '',
tagularSourceKey: 'src_2euJfAVNt6Z9kQz4e9t1SQBtm8x',
tagularWriteKey: 'wk_2euJfDkJVTtEVzsC8BPOb0g9dVj',
tagularSourceKey: process.env.COHESION_TAGULAR_SOURCE_KEY,
tagularWriteKey: process.env.COHESION_TAGULAR_WRITE_KEY,
tagularCookieDomain: 'edx.org',
tagularDomainWhitelist: JSON.stringify([
'edx.org',
Expand Down
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
domainWhitelist: <%= htmlWebpackPlugin?.options?.cohesionConfig?.tagularDomainWhitelist %>,
apiVersion: 'v2/t',
multiparty: true,
taggy: { enabled: true },
}
})
</script>
Expand Down
7 changes: 3 additions & 4 deletions src/payment/data/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ export const TRACK_PAYMENT_BUTTON_CLICK = 'TRACK_PAYMENT_BUTTON_CLICK';
export const trackPaymentButtonClick = tagularElement => {
// Ideally this would happen in a middleware saga for separation of concerns
// but due to deadlines/payment MFE will go away, adding a call here.
// Note: Click events on the PayPal button and Place Order button differ in the type of event data it's treated as.
// Note: Click events on the PayPal button and Place Order button differ in the type of event data,
// and correlation vs. correlationId sent.
let payload;
if (tagularElement.name === 'paypal') {
payload = {
correlation: {
id: getCorrelationID(),
},
correlationId: getCorrelationID(),
webElement: tagularElement,
};
tagularEvent('ElementClicked', payload);
Expand Down
6 changes: 2 additions & 4 deletions src/payment/data/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ export function* handleSubmitPayment({ payload }) {
// RV tracking for successful Stripe Payment
if (method === 'stripe') {
// Metada for conversion_category and conversion_action:
// Sucessful payment = 'Order' and 'Completed'
// Failed payment = 'Enrollment' and 'Declined'
tagularElement.category = 'Order';
tagularElement.category = 'Enrollment';
tagularElement.action = 'Completed';
yield put(trackPaymentButtonClick(tagularElement));
}
Expand All @@ -255,7 +253,7 @@ export function* handleSubmitPayment({ payload }) {
} else {
// RV tracking for failed Stripe Payment
if (method === 'stripe') {
tagularElement.category = 'Enrollment';
tagularElement.category = 'Cart';
tagularElement.action = 'Declined';
yield put(trackPaymentButtonClick(tagularElement));
}
Expand Down

0 comments on commit 963501c

Please sign in to comment.