Skip to content

Commit 7d25023

Browse files
authored
Merge 36e0811 into ef44572
2 parents ef44572 + 36e0811 commit 7d25023

File tree

3 files changed

+181
-54
lines changed

3 files changed

+181
-54
lines changed

packages/analytics-types/index.d.ts

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ export interface EventParams {
143143
value?: number;
144144
event_label?: string;
145145
event_category?: string;
146+
shipping_tier?: string;
147+
item_list_id?: string;
148+
item_list_name?: string;
149+
promotion_id?: string;
150+
promotion_name?: string;
151+
payment_type?: string;
152+
affiliation?: string;
146153
}
147154

148155
/**
@@ -158,6 +165,7 @@ export interface CustomParams {
158165
*/
159166
export type EventNameString =
160167
| 'add_payment_info'
168+
| 'add_shipping_info'
161169
| 'add_to_cart'
162170
| 'add_to_wishlist'
163171
| 'begin_checkout'
@@ -172,10 +180,13 @@ export type EventNameString =
172180
| 'screen_view'
173181
| 'search'
174182
| 'select_content'
183+
| 'select_item'
184+
| 'select_promotion'
175185
| 'set_checkout_option'
176186
| 'share'
177187
| 'sign_up'
178188
| 'timing_complete'
189+
| 'view_cart'
179190
| 'view_item'
180191
| 'view_item_list'
181192
| 'view_promotion'
@@ -184,17 +195,39 @@ export type EventNameString =
184195
export type Currency = string | number;
185196

186197
export interface Item {
187-
brand?: string;
188-
category?: string;
198+
item_id?: string;
199+
item_name?: string;
200+
item_brand?: string;
201+
item_category?: string;
202+
item_category2?: string;
203+
item_category3?: string;
204+
item_category4?: string;
205+
item_category5?: string;
206+
item_variant?: string;
207+
price?: Currency;
208+
quantity?: number;
209+
index?: string;
210+
coupon?: string;
211+
item_list_name?: string;
212+
item_list_id?: string;
213+
discount?: Currency;
214+
affiliation?: string;
189215
creative_name?: string;
190216
creative_slot?: string;
191-
id?: string;
217+
promotion_id?: string;
218+
promotion_name?: string;
192219
location_id?: string;
220+
/** @deprecated Use item_brand instead. */
221+
brand?: string;
222+
/** @deprecated Use item_category instead. */
223+
category?: string;
224+
/** @deprecated Use item_id instead. */
225+
id?: string;
226+
/** @deprecated Use item_name instead. */
193227
name?: string;
194-
price?: Currency;
195-
quantity?: number;
196228
}
197229

230+
/** @deprecated Use Item instead. */
198231
export interface Promotion {
199232
creative_name?: string;
200233
creative_slot?: string;

packages/analytics/src/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ export enum GtagCommand {
3434
* Any other string is also allowed.
3535
*/
3636
export enum EventName {
37+
ADD_SHIPPING_INFO = 'add_shipping_info',
3738
ADD_PAYMENT_INFO = 'add_payment_info',
3839
ADD_TO_CART = 'add_to_cart',
3940
ADD_TO_WISHLIST = 'add_to_wishlist',
4041
BEGIN_CHECKOUT = 'begin_checkout',
42+
/** @deprecated */
4143
CHECKOUT_PROGRESS = 'checkout_progress',
4244
EXCEPTION = 'exception',
4345
GENERATE_LEAD = 'generate_lead',
@@ -49,10 +51,14 @@ export enum EventName {
4951
SCREEN_VIEW = 'screen_view',
5052
SEARCH = 'search',
5153
SELECT_CONTENT = 'select_content',
54+
SELECT_ITEM = 'select_item',
55+
SELECT_PROMOTION = 'select_promotion',
56+
/** @deprecated */
5257
SET_CHECKOUT_OPTION = 'set_checkout_option',
5358
SHARE = 'share',
5459
SIGN_UP = 'sign_up',
5560
TIMING_COMPLETE = 'timing_complete',
61+
VIEW_CART = 'view_cart',
5662
VIEW_ITEM = 'view_item',
5763
VIEW_ITEM_LIST = 'view_item_list',
5864
VIEW_PROMOTION = 'view_promotion',

0 commit comments

Comments
 (0)