Skip to content

Commit

Permalink
Revert "Agrim/CRO-770/Missing-Userid (#17549)" (#17658)
Browse files Browse the repository at this point in the history
This reverts commit baf4303.
  • Loading branch information
amam-deriv authored Nov 27, 2024
1 parent 291993e commit 2611a23
Show file tree
Hide file tree
Showing 26 changed files with 406 additions and 792 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Localize, localize } from '@deriv/translations';
import './add-options-account.scss';
import { useGrowthbookGetFeatureValue } from '@deriv/hooks';
import { useStore, observer } from '@deriv/stores';
import { isMobile, ContentFlag, cacheTrackEvents } from '@deriv/shared';
import { isMobile, ContentFlag } from '@deriv/shared';
import { Analytics } from '@deriv-com/analytics';

const AddOptions = observer(() => {
const { client, traders_hub, ui } = useStore();
Expand Down Expand Up @@ -36,19 +37,12 @@ const AddOptions = observer(() => {
has_effect
onClick={() => {
if (is_traders_dashboard_tracking_enabled) {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_dashboard_form',
properties: {
action: 'account_get',
form_name: 'traders_hub_default',
account_mode: selected_account_type,
account_name: 'cfd_banner',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_dashboard_form', {
action: 'account_get',
form_name: 'traders_hub_default',
account_mode: selected_account_type,
account_name: 'cfd_banner',
});
}

if (is_real && eu_user) {
Expand Down
20 changes: 7 additions & 13 deletions packages/appstore/src/components/app-content.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useEffect } from 'react';
import { routes, WS, cacheTrackEvents } from '@deriv/shared';
import { routes, WS } from '@deriv/shared';
import { useGrowthbookGetFeatureValue } from '@deriv/hooks';
import { observer, useStore } from '@deriv/stores';
import { Analytics } from '@deriv-com/analytics';
import Routes from 'Components/routes/routes';
import classNames from 'classnames';
import './app.scss';
Expand Down Expand Up @@ -50,18 +51,11 @@ const AppContent: React.FC = observer(() => {
useEffect(() => {
if (selected_account_type) {
if (is_traders_dashboard_tracking_enabled) {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_dashboard_form',
properties: {
action: 'open',
form_name: 'traders_hub_default',
account_mode: selected_account_type,
},
},
},
]);
Analytics.trackEvent('ce_tradershub_dashboard_form', {
action: 'open',
form_name: 'traders_hub_default',
account_mode: selected_account_type,
});
}
}
}, [selected_account_type]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useStore } from '@deriv/stores';
import { Analytics } from '@deriv-com/analytics';
import { SessionStore, cacheTrackEvents } from '@deriv/shared';
import { SessionStore } from '@deriv/shared';
import { getAllowedLanguages, Localize } from '@deriv/translations';
import { LabelPairedCircleChevronDownXlBoldIcon, LabelPairedXmarkLgBoldIcon } from '@deriv/quill-icons';
import { TEbooksUrl } from 'Components/banners/book-banner/book-banner';
Expand All @@ -23,17 +23,10 @@ const BookBannerTemplate = ({ e_book_show_way, e_books_url, e_book_from_landing,
};

React.useEffect(() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'open',
...analytics_data,
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'open',
...analytics_data,
});
}, []);

return (
Expand All @@ -52,17 +45,10 @@ const BookBannerTemplate = ({ e_book_show_way, e_books_url, e_book_from_landing,
target='_blank'
rel='noopener noreferrer'
onClick={() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'click download',
...analytics_data,
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'click download',
...analytics_data,
});
}}
>
<Localize i18n_default_text='Download e-book' />
Expand All @@ -82,17 +68,10 @@ const BookBannerTemplate = ({ e_book_show_way, e_books_url, e_book_from_landing,
height='24'
fill='var(--text-prominent)'
onClick={() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'close',
...analytics_data,
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'close',
...analytics_data,
});
SessionStore.remove('show_book');
setIsBannerShows(false);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Localize } from '@deriv/translations';
import { Button, Text, Icon } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import { useCurrentCurrencyConfig } from '@deriv/hooks';
import { routes, cacheTrackEvents } from '@deriv/shared';
import { routes } from '@deriv/shared';
import './deposit-now-banner.scss';

const desktopWidth = 368;
Expand All @@ -23,34 +23,20 @@ const DepositNowBanner = observer(() => {
const { is_eu_user } = traders_hub;

const handleButtonClick = () => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'click_cta',
banner_name: 'first_deposit',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'click_cta',
banner_name: 'first_deposit',
banner_type: 'with_cta',
});
history.push(`${routes.cashier_deposit}${is_crypto_account ? '#deposit' : ''}`);
};

React.useEffect(() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'open',
banner_name: 'first_deposit',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'open',
banner_name: 'first_deposit',
banner_type: 'with_cta',
});
}, []);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import { useDevice } from '@deriv-com/ui';
import { getUrlBase, Jurisdiction, cacheTrackEvents } from '@deriv/shared';
import { getUrlBase, Jurisdiction } from '@deriv/shared';
import { Analytics } from '@deriv-com/analytics';
import { Localize } from '@deriv/translations';
import { Text, Button } from '@deriv/components';
Expand All @@ -14,34 +14,20 @@ const RealAccountCreationBanner = observer(() => {
const device = !isDesktop ? 'mobile' : 'desktop';

const handleClick = () => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'click_cta',
banner_name: 'real_account_cta',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'click_cta',
banner_name: 'real_account_cta',
banner_type: 'with_cta',
});
openRealAccountSignup(Jurisdiction.SVG);
};

useEffect(() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'open',
banner_name: 'real_account_cta',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'open',
banner_name: 'real_account_cta',
banner_type: 'with_cta',
});
}, []);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ import { Icon, Text } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import { Localize } from '@deriv/translations';
import { useDevice } from '@deriv-com/ui';
import { cacheTrackEvents } from '@deriv/shared';

const trackAnalyticsEvent = (
action: TEvents['ce_tradershub_banner']['action'],
account_mode: TEvents['ce_tradershub_banner']['account_mode']
) => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action,
form_name: 'ce_tradershub_banner',
account_mode,
banner_name: 'setup_unsuccessful_wallets_step_3_2',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action,
form_name: 'ce_tradershub_banner',
account_mode,
banner_name: 'setup_unsuccessful_wallets_step_3_2',
banner_type: 'with_cta',
});
};

const WalletsBannerUnsuccessful = observer(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ import { Button, Icon, Text } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import { Localize, localize } from '@deriv/translations';
import { useDevice } from '@deriv-com/ui';
import { cacheTrackEvents } from '@deriv/shared';

const trackAnalyticsEvent = (
action: TEvents['ce_tradershub_banner']['action'],
account_mode: TEvents['ce_tradershub_banner']['account_mode']
) => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action,
form_name: 'ce_tradershub_banner',
account_mode,
banner_name: 'lets_go_wallets_step_1_2',
banner_type: 'with_cta',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action,
form_name: 'ce_tradershub_banner',
account_mode,
banner_name: 'lets_go_wallets_step_1_2',
banner_type: 'with_cta',
});
};

type TProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Icon, Text } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import { Localize } from '@deriv/translations';
import { useDevice } from '@deriv-com/ui';
import { cacheTrackEvents } from '@deriv/shared';

const WalletsBannerUpgrading = observer(() => {
const { traders_hub, common } = useStore();
Expand All @@ -31,20 +30,13 @@ const WalletsBannerUpgrading = observer(() => {
}

React.useEffect(() => {
cacheTrackEvents.loadEvent([
{
event: {
name: 'ce_tradershub_banner',
properties: {
action: 'open',
form_name: 'ce_tradershub_banner',
account_mode: is_demo ? 'demo' : 'real',
banner_name: 'setting_up_wallets_step_2',
banner_type: 'without_url',
},
},
},
]);
Analytics.trackEvent('ce_tradershub_banner', {
action: 'open',
form_name: 'ce_tradershub_banner',
account_mode: is_demo ? 'demo' : 'real',
banner_name: 'setting_up_wallets_step_2',
banner_type: 'without_url',
});
}, [is_demo]);

return (
Expand Down
Loading

0 comments on commit 2611a23

Please sign in to comment.