@shware/analytics 0.1.17 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/index.cjs.map +1 -1
  2. package/dist/index.d.cts +3 -1
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/next/index.cjs +109 -5
  6. package/dist/next/index.cjs.map +1 -1
  7. package/dist/next/index.d.cts +21 -2
  8. package/dist/next/index.d.ts +21 -2
  9. package/dist/next/index.mjs +96 -4
  10. package/dist/next/index.mjs.map +1 -1
  11. package/dist/react-router/index.cjs +98 -4
  12. package/dist/react-router/index.cjs.map +1 -1
  13. package/dist/react-router/index.d.cts +21 -2
  14. package/dist/react-router/index.d.ts +21 -2
  15. package/dist/react-router/index.mjs +95 -3
  16. package/dist/react-router/index.mjs.map +1 -1
  17. package/dist/schema/index.cjs +1 -0
  18. package/dist/schema/index.cjs.map +1 -1
  19. package/dist/schema/index.d.cts +17 -12
  20. package/dist/schema/index.d.ts +17 -12
  21. package/dist/schema/index.mjs +1 -0
  22. package/dist/schema/index.mjs.map +1 -1
  23. package/dist/server/conversions-api.cjs +246 -0
  24. package/dist/server/conversions-api.cjs.map +1 -0
  25. package/dist/server/conversions-api.d.cts +15 -0
  26. package/dist/server/conversions-api.d.ts +15 -0
  27. package/dist/server/conversions-api.mjs +227 -0
  28. package/dist/server/conversions-api.mjs.map +1 -0
  29. package/dist/setup/index.cjs.map +1 -1
  30. package/dist/setup/index.d.cts +3 -1
  31. package/dist/setup/index.d.ts +3 -1
  32. package/dist/setup/index.mjs.map +1 -1
  33. package/dist/track/fbq.cjs +142 -0
  34. package/dist/track/fbq.cjs.map +1 -0
  35. package/dist/track/fbq.d.cts +279 -0
  36. package/dist/track/fbq.d.ts +279 -0
  37. package/dist/track/fbq.mjs +115 -0
  38. package/dist/track/fbq.mjs.map +1 -0
  39. package/dist/track/{ga.cjs → gtag.cjs} +38 -51
  40. package/dist/track/gtag.cjs.map +1 -0
  41. package/dist/track/gtag.d.cts +525 -0
  42. package/dist/track/gtag.d.ts +525 -0
  43. package/dist/track/gtag.mjs +64 -0
  44. package/dist/track/gtag.mjs.map +1 -0
  45. package/dist/track/index.cjs.map +1 -1
  46. package/dist/track/index.d.cts +3 -2
  47. package/dist/track/index.d.ts +3 -2
  48. package/dist/track/index.mjs.map +1 -1
  49. package/dist/{types/index.cjs → track/types.cjs} +2 -2
  50. package/dist/track/types.cjs.map +1 -0
  51. package/dist/track/types.d.cts +116 -0
  52. package/dist/track/types.d.ts +116 -0
  53. package/dist/track/types.mjs +1 -0
  54. package/dist/visitor/index.cjs.map +1 -1
  55. package/dist/visitor/index.d.cts +1 -1
  56. package/dist/visitor/index.d.ts +1 -1
  57. package/dist/visitor/index.mjs.map +1 -1
  58. package/dist/visitor/types.cjs +19 -0
  59. package/dist/visitor/types.cjs.map +1 -0
  60. package/dist/visitor/types.d.cts +16 -0
  61. package/dist/visitor/types.d.ts +16 -0
  62. package/dist/visitor/types.mjs +1 -0
  63. package/dist/visitor/types.mjs.map +1 -0
  64. package/dist/web/index.cjs +4 -0
  65. package/dist/web/index.cjs.map +1 -1
  66. package/dist/web/index.d.cts +2 -1
  67. package/dist/web/index.d.ts +2 -1
  68. package/dist/web/index.mjs +4 -0
  69. package/dist/web/index.mjs.map +1 -1
  70. package/package.json +11 -1
  71. package/dist/track/ga.cjs.map +0 -1
  72. package/dist/track/ga.d.cts +0 -4
  73. package/dist/track/ga.d.ts +0 -4
  74. package/dist/track/ga.mjs +0 -76
  75. package/dist/track/ga.mjs.map +0 -1
  76. package/dist/types/index.cjs.map +0 -1
  77. package/dist/types/index.d.cts +0 -327
  78. package/dist/types/index.d.ts +0 -327
  79. package/dist/types/index.mjs +0 -1
  80. /package/dist/{types/index.mjs.map → track/types.mjs.map} +0 -0
@@ -0,0 +1,525 @@
1
+ /** reference: https://support.google.com/analytics/answer/13316687 */
2
+ declare const reservedWebEventNames: readonly ["app_remove", "app_store_refund", "app_store_subscription_cancel", "app_store_subscription_renew", "click", "error", "file_download", "first_open", "first_visit", "form_start", "form_submit", "in_app_purchase", "page_view", "scroll", "session_start", "user_engagement", "view_complete", "video_progress", "video_start", "view_search_results"];
3
+ declare const reservedAppEventNames: readonly ["ad_activeview", "ad_click", "ad_exposure", "ad_impression", "ad_query", "ad_reward", "adunit_exposure", "app_clear_data", "app_exception", "app_install", "app_remove", "app_store_refund", "app_update", "app_upgrade", "dynamic_link_app_open", "dynamic_link_app_update", "dynamic_link_first_open", "error", "firebase_campaign", "firebase_in_app_message_action", "firebase_in_app_message_dismiss", "firebase_in_app_message_impression", "first_open", "first_visit", "in_app_purchase", "notification_dismiss", "notification_foreground", "notification_open", "notification_receive", "notification_send", "os_update", "screen_view", "session_start", "user_engagement"];
4
+ declare const reservedEventNames: readonly ["app_remove", "app_store_refund", "app_store_subscription_cancel", "app_store_subscription_renew", "click", "error", "file_download", "first_open", "first_visit", "form_start", "form_submit", "in_app_purchase", "page_view", "scroll", "session_start", "user_engagement", "view_complete", "video_progress", "video_start", "view_search_results", "ad_activeview", "ad_click", "ad_exposure", "ad_impression", "ad_query", "ad_reward", "adunit_exposure", "app_clear_data", "app_exception", "app_install", "app_remove", "app_store_refund", "app_update", "app_upgrade", "dynamic_link_app_open", "dynamic_link_app_update", "dynamic_link_first_open", "error", "firebase_campaign", "firebase_in_app_message_action", "firebase_in_app_message_dismiss", "firebase_in_app_message_impression", "first_open", "first_visit", "in_app_purchase", "notification_dismiss", "notification_foreground", "notification_open", "notification_receive", "notification_send", "os_update", "screen_view", "session_start", "user_engagement"];
5
+ type ReservedWebEventNames = (typeof reservedWebEventNames)[number];
6
+ type ReservedAppEventNames = (typeof reservedAppEventNames)[number];
7
+ type ReservedEventNames = ReservedWebEventNames | ReservedAppEventNames;
8
+ type ReservedEventValues = 'cid' | 'currency' | 'customer_id' | 'customerid' | 'dclid' | 'gclid' | 'session_id' | 'sessionid' | 'sfmc_id' | 'sid' | 'srsltid' | 'uid' | 'user_id' | 'userid' | `_${string}` | `firebase_${string}` | `ga_${string}` | `google_${string}` | `gtag.${string}`;
9
+ type ReservedUserPropertiesNames = 'cid' | 'customer_id' | 'customerid' | 'first_open_after_install' | 'first_open_time' | 'first_visit_time' | 'google_allow_ad_personalization_signals' | 'last_advertising_id_reset' | 'last_deep_link_referrer' | 'last_gclid' | 'lifetime_user_engagement' | 'non_personalized_ads' | 'session_id' | 'session_number' | 'sessionid' | 'sfmc_id' | 'sid' | 'uid' | 'user_id' | 'userid' | `_${string}` | `firebase_${string}` | `ga_${string}` | `google_${string}`;
10
+ type UserPropertiesValue = string | boolean | number | null | undefined;
11
+ type UserProperties = {
12
+ [key: string]: UserPropertiesValue;
13
+ } & {
14
+ [key in ReservedUserPropertiesNames]?: never;
15
+ };
16
+ /**
17
+ * reference: https://support.google.com/analytics/answer/14078702
18
+ * You must turn on user-provided data collection in Google Analytics.
19
+ *
20
+ * Validate your user-provided data implementation: https://support.google.com/analytics/answer/14171683
21
+ *
22
+ * Usage: gtag('set', 'user_data', { email: 'abc@abc.com' })
23
+ *
24
+ * In order to standardize the hash results, prior to hashing one of these values you must:
25
+ *
26
+ * - Remove leading and trailing whitespaces.
27
+ * - Convert the text to lowercase.
28
+ * - Format phone numbers according to the E164 standard.
29
+ * - Remove all periods (.) that precede the domain name in gmail.com and googlemail.com email addresses.
30
+ * */
31
+ type UserProvidedDataAddress = {
32
+ first_name?: string;
33
+ last_name?: string;
34
+ street?: string;
35
+ city?: string;
36
+ /** User province, state, or region. Example: `Hampshire` */
37
+ region?: string;
38
+ postal_code?: string;
39
+ /**
40
+ * User country code.
41
+ * Example: 'UK'. Use 2-letter country codes, per the ISO 3166-1 alpha-2 standard.
42
+ */
43
+ country?: string;
44
+ };
45
+ /**
46
+ * In order to standardize the hash results, prior to hashing one of these values you must:
47
+ *
48
+ * - Remove leading and trailing whitespaces.
49
+ * - Convert the text to lowercase.
50
+ * - Format phone numbers according to the E164 standard.
51
+ * - Remove all periods (.) that precede the domain name in gmail.com and googlemail.com email addresses.
52
+ */
53
+ type UserProvidedData = {
54
+ email?: string | string[];
55
+ /**
56
+ * User phone number. Must be in E.164 format, which means it must be 11 to 15 digits including a
57
+ * plus sign (+) prefix and country code with no dashes, parentheses, or spaces.
58
+ *
59
+ * Example: ‘+11231234567’
60
+ */
61
+ phone_number?: string | string[];
62
+ address?: UserProvidedDataAddress | UserProvidedDataAddress[];
63
+ };
64
+ type GaId = `G-${Uppercase<string>}`;
65
+ type GtmId = `GTM-${Uppercase<string>}`;
66
+ type CampaignMedium = 'email' | 'organic' | 'cpc' | 'banner' | 'social' | 'referral' | 'affiliate' | 'video' | 'display' | 'sms' | 'push' | 'qr' | 'audio' | (string & {});
67
+ type CampaignSource = 'google' | 'googleads' | 'bing' | 'bingads' | 'metaads' | 'facebook' | 'twitter' | 'linkedin' | 'instagram' | 'tiktok' | 'youtube' | 'newsletter' | `website_${string}` | `affiliate_${string}` | (string & {});
68
+ type Campaign = {
69
+ id?: string;
70
+ name?: string;
71
+ term?: string;
72
+ content?: string;
73
+ medium?: CampaignMedium;
74
+ source?: CampaignSource;
75
+ };
76
+ type Config = {
77
+ allow_google_signals?: boolean;
78
+ allow_ad_personalization_signals?: boolean;
79
+ campaign_content?: string;
80
+ campaign_id?: string;
81
+ campaign_medium?: CampaignMedium;
82
+ campaign_name?: string;
83
+ campaign_source?: CampaignSource;
84
+ campaign_term?: string;
85
+ /**
86
+ * @deprecated
87
+ * Key Point: Use the campaign_ prefixed version of each campaign value instead of this field.
88
+ */
89
+ campaign?: Campaign;
90
+ client_id?: string;
91
+ content_group?: string;
92
+ cookie_domain?: 'none' | 'auto' | string;
93
+ cookie_expires?: number;
94
+ cookie_flags?: string;
95
+ cookie_path?: string;
96
+ cookie_prefix?: string;
97
+ cookie_update?: boolean;
98
+ ignore_referrer?: boolean;
99
+ language?: string;
100
+ page_location?: string;
101
+ page_referrer?: string;
102
+ page_title?: string;
103
+ send_page_view?: boolean;
104
+ screen_resolution?: `${number}x${number}`;
105
+ user_id?: string;
106
+ user_properties?: UserProperties;
107
+ };
108
+ type Item = {
109
+ item_id: string;
110
+ item_name: string;
111
+ affiliation?: 'Google Store' | (string & {});
112
+ coupon?: string;
113
+ discount?: number;
114
+ index?: number;
115
+ item_brand?: string;
116
+ item_category?: string;
117
+ item_category2?: string;
118
+ item_category3?: string;
119
+ item_category4?: string;
120
+ item_category5?: string;
121
+ item_list_id?: string;
122
+ item_list_name?: string;
123
+ item_variant?: string;
124
+ location_id?: string;
125
+ price?: number;
126
+ quantity?: number;
127
+ };
128
+ type PromotionItem = {
129
+ creative_name?: string;
130
+ creative_slot?: string;
131
+ promotion_id?: string;
132
+ promotion_name?: string;
133
+ };
134
+ /**
135
+ * ref: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag
136
+ * ref: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event
137
+ * */
138
+ type StandardEvents = {
139
+ add_payment_info: {
140
+ currency: string;
141
+ value: number;
142
+ coupon?: string;
143
+ payment_type?: string;
144
+ items: Item[];
145
+ };
146
+ add_shipping_info: {
147
+ currency: string;
148
+ value: number;
149
+ coupon?: string;
150
+ shipping_tier?: string;
151
+ items: Item[];
152
+ };
153
+ add_to_cart: {
154
+ currency: string;
155
+ value: number;
156
+ items: Item[];
157
+ };
158
+ add_to_wishlist: {
159
+ currency: string;
160
+ value: number;
161
+ items: Item[];
162
+ };
163
+ begin_checkout: {
164
+ currency: string;
165
+ value: number;
166
+ coupon?: string;
167
+ items: Item[];
168
+ };
169
+ close_convert_lead: {
170
+ currency: string;
171
+ value: number;
172
+ };
173
+ close_unconvert_lead: {
174
+ currency: string;
175
+ value: number;
176
+ unconvert_lead_reason?: string;
177
+ };
178
+ disqualify_lead: {
179
+ currency: string;
180
+ value: number;
181
+ disqualified_lead_reason?: string;
182
+ };
183
+ earn_virtual_currency: {
184
+ virtual_currency_name?: string;
185
+ value?: number;
186
+ };
187
+ generate_lead: {
188
+ currency: string;
189
+ value: number;
190
+ lead_source?: string;
191
+ };
192
+ join_group: {
193
+ group_id?: string;
194
+ };
195
+ level_end: {
196
+ level_name?: string;
197
+ success?: boolean;
198
+ };
199
+ level_start: {
200
+ level_name?: string;
201
+ };
202
+ level_up: {
203
+ level?: number;
204
+ level_name?: string;
205
+ character?: string;
206
+ };
207
+ login: {
208
+ method?: string;
209
+ };
210
+ post_score: {
211
+ score: number;
212
+ level?: number;
213
+ character?: string;
214
+ };
215
+ purchase: {
216
+ currency: string;
217
+ value: number;
218
+ transaction_id: string;
219
+ coupon?: string;
220
+ shipping?: number;
221
+ tax?: number;
222
+ items?: Item[];
223
+ };
224
+ qualify_lead: {
225
+ currency: string;
226
+ value: number;
227
+ };
228
+ refund: {
229
+ currency: string;
230
+ value: number;
231
+ transaction_id: string;
232
+ coupon?: string;
233
+ shipping?: number;
234
+ tax?: number;
235
+ items?: Item[];
236
+ };
237
+ remove_from_cart: {
238
+ currency: string;
239
+ value: number;
240
+ items: Item[];
241
+ };
242
+ search: {
243
+ search_term: string;
244
+ };
245
+ select_content: {
246
+ content_type?: string;
247
+ content_id?: string;
248
+ };
249
+ select_item: {
250
+ item_list_id?: string;
251
+ item_list_name?: string;
252
+ items: Item[];
253
+ };
254
+ select_promotion: {
255
+ creative_name?: string;
256
+ creative_slot?: string;
257
+ promotion_id?: string;
258
+ promotion_name?: string;
259
+ items?: (Item & PromotionItem)[];
260
+ };
261
+ share: {
262
+ method?: string;
263
+ content_type?: string;
264
+ item_id?: string;
265
+ };
266
+ sign_up: {
267
+ method?: string;
268
+ };
269
+ spend_virtual_currency: {
270
+ value: number;
271
+ virtual_currency_name: string;
272
+ item_name?: string;
273
+ };
274
+ tutorial_begin: undefined;
275
+ tutorial_complete: undefined;
276
+ unlock_achievement: {
277
+ achievement_id: string;
278
+ };
279
+ view_cart: {
280
+ currency: string;
281
+ value: number;
282
+ items: Item[];
283
+ };
284
+ view_item: {
285
+ currency: string;
286
+ value: number;
287
+ items: Item[];
288
+ };
289
+ view_item_list: {
290
+ currency: string;
291
+ item_list_id?: string;
292
+ item_list_name?: string;
293
+ items: Item[];
294
+ };
295
+ view_promotion: {
296
+ creative_name?: string;
297
+ creative_slot?: string;
298
+ promotion_id?: string;
299
+ promotion_name?: string;
300
+ items: (Item & PromotionItem)[];
301
+ };
302
+ working_lead: {
303
+ currency: string;
304
+ value: number;
305
+ lead_status?: string;
306
+ };
307
+ ad_impression: {
308
+ value?: number;
309
+ currency?: string;
310
+ ad_format?: string;
311
+ ad_platform?: string;
312
+ ad_source?: string;
313
+ ad_unit_name?: string;
314
+ };
315
+ app_open: undefined;
316
+ campaign_details: {
317
+ source: string;
318
+ medium: string;
319
+ campaign: string;
320
+ term?: string;
321
+ content?: string;
322
+ aclid?: string;
323
+ cp1?: string;
324
+ };
325
+ screen_view: {
326
+ screen_name?: string;
327
+ screen_class?: string;
328
+ };
329
+ view_search_results: {
330
+ search_term: string;
331
+ };
332
+ trial_begin: {
333
+ currency: string;
334
+ value: number;
335
+ };
336
+ subscribe: {
337
+ currency: string;
338
+ value: number;
339
+ };
340
+ };
341
+ /**
342
+ * reference: https://developers.google.com/analytics/devguides/collection/ga4/reference/config
343
+ * reference: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag
344
+ */
345
+ interface Gtag {
346
+ /**
347
+ * To disable advertising features based on third-party advertising identifiers, set
348
+ * allow_google_signals to false.
349
+ *
350
+ * @param allow - Whether to allow Google signals.
351
+ * @default true
352
+ */
353
+ gtag(event: 'set', option: 'allow_google_signals', allow: boolean): void;
354
+ /**
355
+ * Set to false to disable advertising personalization features.
356
+ *
357
+ * @param allow - Whether to allow ad personalization signals.
358
+ * @default true
359
+ */
360
+ gtag(event: 'set', option: 'allow_ad_personalization_signals', allow: boolean): void;
361
+ /**
362
+ * Used for A/B testing and content-targeted ads. Use campaign_content to differentiate ads or
363
+ * links that point to the same URL.
364
+ */
365
+ gtag(event: 'set', option: 'campaign_content', content: string): void;
366
+ /**
367
+ * Used to identify which campaign this referral references. Use campaign_id to identify a
368
+ * specific campaign.
369
+ */
370
+ gtag(event: 'set', option: 'campaign_id', id: string): void;
371
+ /** Use campaign_medium to identify a medium such as email or cost-per-click. */
372
+ gtag(event: 'set', option: 'campaign_medium', medium: CampaignMedium): void;
373
+ /**
374
+ * Used for keyword analysis. Use campaign_name to identify a specific product promotion or
375
+ * strategic campaign.
376
+ */
377
+ gtag(event: 'set', option: 'campaign_name', name: string): void;
378
+ /** Use campaign_source to identify a search engine, newsletter name, or other source. */
379
+ gtag(event: 'set', option: 'campaign_source', source: CampaignSource): void;
380
+ /** Used for paid search. Use campaign_term to note the keywords for this ad. */
381
+ gtag(event: 'set', option: 'campaign_term', term: string): void;
382
+ /**
383
+ * @deprecated
384
+ * Key Point: Use the campaign_ prefixed version of each campaign value instead of this field.
385
+ */
386
+ gtag(event: 'set', option: 'campaign', params: Campaign): void;
387
+ /**
388
+ * Pseudonymously identifies a browser instance. By default, this value is stored as part of the
389
+ * first-party Analytics cookie with a two-year expiration.
390
+ */
391
+ gtag(event: 'set', option: 'client_id', id: string): void;
392
+ /** example: gtag('set', 'content_group', '/news/sports'); */
393
+ gtag(event: 'set', option: 'content_group', group: string): void;
394
+ /**
395
+ * Specifies the domain used to store the analytics cookie.
396
+ * Set to 'none' to set the cookie without specifying a domain.
397
+ * Set to 'auto' (the default value) to set the cookie to the top level domain plus one
398
+ * subdomain (eTLD +1). For example if cookie_domain is set to 'auto' https://example.com would
399
+ * use example.com for the domain, and https://subdomain.example.com would also use example.com
400
+ * for the domain.
401
+ *
402
+ * @param domain - The domain used to store the analytics cookie.
403
+ * @default 'auto'
404
+ */
405
+ gtag(event: 'set', option: 'cookie_domain', domain: 'none' | 'auto' | string): void;
406
+ /**
407
+ * Every time a hit is sent to Google Analytics, the cookie expiration time is updated to be the
408
+ * current time plus the value of the cookie_expires field. This means that if you use the default
409
+ * value time of two years (63072000 seconds), and a user visits your site every month, their
410
+ * cookie will never expire.
411
+ *
412
+ * If you set the cookie_expires time to 0 (zero) seconds, the cookie turns into a session based
413
+ * cookie and expires once the current browser session ends.
414
+ *
415
+ * Caution: If you set the cookie to expire too quickly, you will inflate your user count and
416
+ * decrease the quality of your measurement.
417
+ *
418
+ * @param expires - The number of seconds until the cookie expires.
419
+ * @default 63072000
420
+ */
421
+ gtag(event: 'set', option: 'cookie_expires', expires: number): void;
422
+ /**
423
+ * Appends additional flags to the cookie when set. Flags must be separated by semicolons. See
424
+ * [write a new cookie](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#write_a_new_cookie) for some examples of flags to set.
425
+ */
426
+ gtag(event: 'set', option: 'cookie_flags', flags: string): void;
427
+ /** Specifies the subpath used to store the analytics cookie. */
428
+ gtag(event: 'set', option: 'cookie_path', path: string): void;
429
+ /** Specifies a prefix to prepend to analytics cookie names. */
430
+ gtag(event: 'set', option: 'cookie_prefix', prefix: string): void;
431
+ /**
432
+ * When cookie_update is set to true, gtag.js will update cookies on each page load. This will
433
+ * update the cookie expiration to be set relative to the most recent visit to the site. For
434
+ * example, if cookie expiration is set to one week, and a user visits using the same browser
435
+ * every five days, the cookie expiration will be updated on each visit and will effectively
436
+ * never expire.
437
+ *
438
+ * When set to false, cookies are not updated on each page load. This has the effect of cookie
439
+ * expiration being relative to the first time a user visited the site.
440
+ *
441
+ * @param update - Whether to update the cookie on each page load.
442
+ * @default true
443
+ */
444
+ gtag(event: 'set', option: 'cookie_update', update: boolean): void;
445
+ /**
446
+ * Set to true to indicate to Analytics that the referrer shouldn't be displayed as a traffic
447
+ * source. [Learn when to use this field](https://support.google.com/analytics/answer/10327750#set-parameter)
448
+ *
449
+ * @param ignore - Whether to ignore the referrer.
450
+ * @default false
451
+ */
452
+ gtag(event: 'set', option: 'ignore_referrer', ignore: boolean): void;
453
+ /**
454
+ * Specifies the language preference of the user. Defaults to the user's navigator.language value.
455
+ *
456
+ * @param language - The language preference of the user.
457
+ * @default navigator.language
458
+ */
459
+ gtag(event: 'set', option: 'language', language: string): void;
460
+ /**
461
+ * Specifies the full URL of the page. Defaults to the user's document.location value.
462
+ *
463
+ * @param location - The full URL of the page. Character limit 1000
464
+ * @default document.location
465
+ */
466
+ gtag(event: 'set', option: 'page_location', location: string): void;
467
+ /**
468
+ * Specifies which referral source brought traffic to a page. This value is also used to compute
469
+ * the traffic source. The format of this value is a URL. Defaults to the user's document.referrer
470
+ * value.
471
+ *
472
+ * @param referrer - The referral source. Character limit 420
473
+ * @default document.referrer
474
+ */
475
+ gtag(event: 'set', option: 'page_referrer', referrer: string): void;
476
+ /**
477
+ * The title of the page or document. Defaults to the user's document.title value.
478
+ *
479
+ * @param title - The title of the page or document. Character limit 300
480
+ * @default document.title
481
+ */
482
+ gtag(event: 'set', option: 'page_title', title: string): void;
483
+ /**
484
+ * Set to false to prevent the default snippet from sending a page_view.
485
+ *
486
+ * @param send - Whether to send a page_view.
487
+ * @default true
488
+ */
489
+ gtag(event: 'set', option: 'send_page_view', send: boolean): void;
490
+ /**
491
+ * Specifies the resolution of the screen. Should be two positive integers separated by an x. For
492
+ * example, for an 800px by 600px screen, the value would be 800x600. Calculated from the user's
493
+ * window.screen value.
494
+ *
495
+ * @param resolution - The resolution of the screen.
496
+ * @default window.screen
497
+ */
498
+ gtag(event: 'set', option: 'screen_resolution', resolution: `${number}x${number}`): void;
499
+ /**
500
+ * Specifies a known identifier for a user provided by the site owner/library user. It must not
501
+ * itself be PII (personally identifiable information). The value should never be persisted in
502
+ * Google Analytics cookies or other Analytics provided storage.
503
+ *
504
+ * @param userId - The user ID. Character limit 256
505
+ */
506
+ gtag(event: 'set', option: 'user_id', userId: string): void;
507
+ /**
508
+ * User properties are attributes that can be used to describe segments of your user base, such
509
+ * as language preference or geographic location. Up to 25 additional user properties can be set
510
+ * per project.
511
+ *
512
+ * @param name - The name of the user property. Character limit 24
513
+ * @param value - The value of the user property. Character limit 36
514
+ */
515
+ gtag(event: 'set', option: 'user_properties', properties: UserProperties): void;
516
+ gtag(event: 'set', option: 'user_data', data: UserProvidedData): void;
517
+ /**
518
+ * gtag('config', ...) Set for a single stream
519
+ * gtag('set', ...) Set globally
520
+ */
521
+ gtag(event: 'config', gaId: GaId, config?: Config): void;
522
+ gtag<T extends string>(event: 'event', eventName: T extends keyof StandardEvents ? T : string, eventParams?: T extends keyof StandardEvents ? StandardEvents[T] : Record<string, string | number | boolean | null | undefined>): void;
523
+ }
524
+
525
+ export { type Campaign, type CampaignMedium, type CampaignSource, type Config, type GaId, type Gtag, type GtmId, type Item, type PromotionItem, type ReservedEventNames, type ReservedEventValues, type ReservedUserPropertiesNames, type StandardEvents, type UserProperties, type UserPropertiesValue, type UserProvidedData, reservedEventNames };