Skip to content

Commit 2bf1629

Browse files
committed
Revert "fix: include items array in purchase dataLayer (#8339)"
This reverts commit ef8657b.
1 parent 17bd5f5 commit 2bf1629

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

src/platform/cloud/subscription/composables/useSubscription.test.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,10 @@ describe('useSubscription', () => {
237237
event: 'purchase',
238238
transaction_id: 'sub_123',
239239
currency: 'USD',
240-
items: [
241-
{
242-
item_id: 'monthly_creator',
243-
item_variant: 'monthly',
244-
item_category: 'subscription',
245-
quantity: 1
246-
}
247-
]
240+
item_id: 'monthly_creator',
241+
item_variant: 'monthly',
242+
item_category: 'subscription',
243+
quantity: 1
248244
})
249245
expect(localStorage.getItem('pending_subscription_purchase')).toBeNull()
250246
})

src/platform/cloud/subscription/composables/useSubscription.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,18 @@ function useSubscriptionInternal() {
121121
: baseName
122122
const unitPrice = getTierPrice(tierKey, isYearly)
123123
const value = isYearly && tierKey !== 'founder' ? unitPrice * 12 : unitPrice
124+
124125
pushDataLayerEvent({
125126
event: 'purchase',
126127
transaction_id: status.subscription_id,
127128
value,
128129
currency: 'USD',
129-
items: [
130-
{
131-
item_id: `${billingCycle}_${tierKey}`,
132-
item_name: planName,
133-
item_category: 'subscription',
134-
item_variant: billingCycle,
135-
price: value,
136-
quantity: 1
137-
}
138-
]
130+
item_id: `${billingCycle}_${tierKey}`,
131+
item_name: planName,
132+
item_category: 'subscription',
133+
item_variant: billingCycle,
134+
price: value,
135+
quantity: 1
139136
})
140137

141138
clearPendingSubscriptionPurchase()

0 commit comments

Comments
 (0)