Skip to content

Commit

Permalink
purchase tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
mantikoros committed Nov 2, 2024
1 parent 341a5c5 commit 53a4bbd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/api/src/gidx/complete-checkout-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ProcessSessionCode,
} from 'common/gidx/gidx'
import { introductoryTimeWindow, User } from 'common/user'
import { getIp, track } from 'shared/analytics'
import { getIp, track, trackPublicEvent } from 'shared/analytics'
import {
getGIDXStandardParams,
getLocalServerIP,
Expand Down Expand Up @@ -276,4 +276,13 @@ const sendCoins = async (
)
}
})

await trackPublicEvent(user.id, 'M$ purchase', {
amount: amount.mana,
priceInDollars: amount.priceInDollars,
bonusInDollars: amount.bonusInDollars,
transactionId,
sessionId,
source: 'gidx',
})
}

0 comments on commit 53a4bbd

Please sign in to comment.