From 1593b94aacd69a9c48c04a13d696c4c0bede4d58 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 15:07:37 -0800 Subject: feat(instant): Add more event properties to heap --- packages/instant/src/util/analytics.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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), -- cgit v1.2.3