File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -550,15 +550,24 @@ const useSignup = () => {
550
550
simplePlans = [ { plan : restOfPlan } ] ;
551
551
}
552
552
553
+ const adaptedItems = simplePlans . map ( ( planObj ) => ( {
554
+ item_id : planObj . plan . slug ,
555
+ item_name : planObj . plan . slug ,
556
+ price : transactionData ?. amount || 0 ,
557
+ quantity : 1 ,
558
+ item_category : 'subscription' ,
559
+ subscription_period : selectedPlan ?. period_label || 'one-time' ,
560
+ } ) ) ;
553
561
reportDatalayer ( {
554
562
dataLayer : {
555
563
event : 'purchase' ,
556
- value : selectedPlan ?. price || 0 ,
564
+ transaction_id : transactionData ?. id ,
565
+ value : transactionData ?. amount || 0 ,
557
566
currency,
558
567
payment_type : 'Credit card' ,
559
568
plan : selectedPlan ?. plan_slug || transactionData ?. plan ?. slug || defaultPlan ,
560
569
period_label : selectedPlan ?. period_label || 'one-time' ,
561
- items : simplePlans ,
570
+ items : adaptedItems ,
562
571
agent : getBrowserInfo ( ) ,
563
572
} ,
564
573
} ) ;
You can’t perform that action at this time.
0 commit comments