Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
fix: update tracking system with new requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitK-deriv committed Jan 5, 2024
1 parent b7b323b commit 0aabc37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export const onClientEntry = () => {
device_language: navigator?.language || ' ',
device_type: isMobile ? 'mobile' : 'desktop',
})
Analytics?.identifyEvent()
//datadog
const dd_options = {
clientToken: process.env.GATSBY_DATADOG_CLIENT_TOKEN,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/signup-affiliates/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ const AffiliateSignup = () => {

useEffect(() => {
const partner_signup_error_message = affiliate_api_error?.error.message
console.log(partner_signup_error_message)
if (affiliate_api_data) {
trackEvent({
action: 'success_popup_opened',
user_choice:
JSON.stringify(affiliate_api_error?.echo_req) ||
'success, but without echo_req',
success_source: partner_signup_error_message ? 'failed_popup' : 'last_step',
})
setSignupStatus('success')
} else if (partner_signup_error_message == 'Username not available') {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/signup-affiliates/utils/_utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const trackEvent = ({
email,
partner_signup_error_message,
user_choice,
success_source,
step_num,
step_codename,
}: TEvents['ce_partner_account_signup_form']) => {
Expand All @@ -83,6 +84,7 @@ export const trackEvent = ({
form_name: 'ce_partner_account_signup_form',
...(email && { email }),
...(user_choice && { user_choice }),
...(success_source && { success_source }),
...(step_num && { step_num }),
...(step_codename && { step_codename }),
...(partner_signup_error_message && { partner_signup_error_message }),
Expand Down

0 comments on commit 0aabc37

Please sign in to comment.