File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,6 +406,13 @@ export const planChanged = async ({ data }: SubscriptionUpdatedEvent) => {
406406 ) ;
407407} ;
408408
409+ const getAnalyticsTargetType = ( event : EventEntity ) : TargetType => {
410+ if ( isPurchaseType ( PurchaseType . Cores , event ) ) return TargetType . Credits ;
411+ if ( isPurchaseType ( PurchaseType . Recruiter , event ) )
412+ return TargetType . Recruiter ;
413+ return TargetType . Plus ;
414+ } ;
415+
409416export const logPaddleAnalyticsEvent = async (
410417 event :
411418 | SubscriptionUpdatedEvent
@@ -443,9 +450,7 @@ export const logPaddleAnalyticsEvent = async (
443450 app_platform : 'api' ,
444451 user_id : analyticsId ,
445452 extra : JSON . stringify ( getAnalyticsExtra ( event ) ) ,
446- target_type : isPurchaseType ( PurchaseType . Cores , event )
447- ? TargetType . Credits
448- : TargetType . Plus ,
453+ target_type : getAnalyticsTargetType ( event ) ,
449454 } ,
450455 ] ) ;
451456} ;
Original file line number Diff line number Diff line change @@ -75,4 +75,5 @@ export async function sendExperimentAllocationEvent<
7575export enum TargetType {
7676 Plus = 'plus' ,
7777 Credits = 'credits' ,
78+ Recruiter = 'recruiter' ,
7879}
You can’t perform that action at this time.
0 commit comments