Skip to content

Commit 6ab5612

Browse files
committed
allow in app purchase events for app streams
1 parent da12b8b commit 6ab5612

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/components/ga4/EventBuilder/event.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,22 @@ const generate_lead = eventFor(
201201
[stringParam("currency", "USD"), numberParam("value", 99.99)]
202202
)
203203

204+
const in_app_purchase = eventFor(
205+
EventType.InAppPurchase,
206+
[Category.AllApps],
207+
[
208+
stringParam("currency", "USD"),
209+
numberParam("value", 30.03),
210+
numberParam("quantity", 3),
211+
stringParam("product_id", "ABC123456789"),
212+
stringParam("subscription", "true"),
213+
stringParam("free_trial", "false"),
214+
stringParam("price_is_discounted", "false"),
215+
],
216+
undefined,
217+
["app"]
218+
)
219+
204220
const join_group = eventFor(
205221
EventType.JoinGroup,
206222
[Category.AllApps],
@@ -548,6 +564,8 @@ export const suggestedEventFor = (eventType: EventType): Event2 => {
548564
return earn_virtual_currency
549565
case EventType.GenerateLead:
550566
return generate_lead
567+
case EventType.InAppPurchase:
568+
return in_app_purchase
551569
case EventType.JoinGroup:
552570
return join_group
553571
case EventType.LevelUp:

src/components/ga4/EventBuilder/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export enum EventType {
6060
ViewItemList = "view_item_list",
6161
ViewPromotion = "view_promotion",
6262
ViewSearchResults = "view_search_results",
63+
InAppPurchase = "in_app_purchase",
6364
}
6465

6566
export interface NumberParameter {

0 commit comments

Comments
 (0)