diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-21 07:07:37 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-21 07:07:37 +0800 |
commit | 1593b94aacd69a9c48c04a13d696c4c0bede4d58 (patch) | |
tree | e7e66071134d174f65c3ebecbf36c49723790449 /packages | |
parent | 6124d80c89e7c8e4b1d00a934f2389d2b4461c44 (diff) | |
download | dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar.gz dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar.bz2 dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar.lz dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar.xz dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.tar.zst dexon-sol-tools-1593b94aacd69a9c48c04a13d696c4c0bede4d58.zip |
feat(instant): Add more event properties to heap
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index d790ec1e7..a18532bfa 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -51,6 +51,8 @@ export interface AnalyticsEventOptions { gitSha?: string; npmVersion?: string; orderSource?: string; + affiliateAddress?: string; + affiliateFeePercent?: number; } export const analytics = { addUserProperties: (properties: AnalyticsUserOptions): void => { @@ -72,6 +74,8 @@ export const analytics = { orderSource = 'provided'; } + const affiliateAddress = state.affiliateInfo ? state.affiliateInfo.feeRecipient : 'none'; + const affiliateFeePercent = state.affiliateInfo ? parseFloat(state.affiliateInfo.feePercentage.toFixed(4)) : 0; return { embeddedHost: window.location.host, embeddedUrl: window.location.href, @@ -80,6 +84,8 @@ export const analytics = { gitSha: process.env.GIT_SHA, npmVersion: process.env.NPM_PACKAGE_VERSION, orderSource, + affiliateAddress, + affiliateFeePercent, }; }, trackWalletReady: trackingEventFnWithoutPayload(EventNames.WALLET_READY), |