From 53a4bbd48494f94e7be0dc3869c7f436c799795c Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 1 Nov 2024 17:21:04 -0700 Subject: [PATCH] purchase tracking --- backend/api/src/gidx/complete-checkout-session.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/api/src/gidx/complete-checkout-session.ts b/backend/api/src/gidx/complete-checkout-session.ts index df2a310d25..adb1ef1a5f 100644 --- a/backend/api/src/gidx/complete-checkout-session.ts +++ b/backend/api/src/gidx/complete-checkout-session.ts @@ -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, @@ -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', + }) }