Skip to content

Commit

Permalink
fix: depositTotal should be a string
Browse files Browse the repository at this point in the history
  • Loading branch information
emuvente committed Dec 1, 2023
1 parent 7214347 commit 7847e33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions @kiva/kv-analytics/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface TransactionData {
kivaCardCount: number,
kivaCardTotal: string,
itemTotal: string,
depositTotal: number,
depositTotal: string,
kivaCreditAppliedTotal: string,
paymentType: string,
isFTD: boolean,
Expand Down Expand Up @@ -164,12 +164,12 @@ function trackGATransaction(transactionData: TransactionData) {
}

function trackOPTransaction(transactionData: TransactionData) {
if (transactionData.depositTotal > 0) {
if (Number(transactionData.depositTotal) > 0) {
window.optimizely.push({
type: 'event',
eventName: 'deposit',
tags: {
revenue: transactionData.depositTotal * 100,
revenue: Number(transactionData.depositTotal) * 100,
deposit_amount: transactionData.depositTotal,
},
});
Expand Down Expand Up @@ -221,6 +221,7 @@ export function trackEvent(
label?: string,
property?: string,
value?: string,
// eslint-disable-next-line @typescript-eslint/no-empty-function
callback: (err: any) => void = () => {},
) {
const eventLabel = (label !== undefined && label !== null) ? String(label) : undefined;
Expand Down

0 comments on commit 7847e33

Please sign in to comment.