@@ -23,19 +23,77 @@ import { FirebaseApp } from '@firebase/app-exp';
23
23
* @public
24
24
*/
25
25
export interface GtagConfigParams {
26
+ /**
27
+ * Whether or not a page view should be sent.
28
+ * If set to true (default), a page view is automatically sent upon initialization
29
+ * of analytics.
30
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
31
+ */
26
32
'send_page_view' ?: boolean ;
33
+ /**
34
+ * The title of the page.
35
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
36
+ */
27
37
'page_title' ?: string ;
38
+ /**
39
+ * The path to the page. If overridden, this value must start with a / character.
40
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
41
+ */
28
42
'page_path' ?: string ;
43
+ /**
44
+ * The URL of the page.
45
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
46
+ */
29
47
'page_location' ?: string ;
48
+ /**
49
+ * Defaults to `auto`.
50
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
51
+ */
30
52
'cookie_domain' ?: string ;
53
+ /**
54
+ * Defaults to 63072000 (two years, in seconds).
55
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
56
+ */
31
57
'cookie_expires' ?: number ;
58
+ /**
59
+ * Defaults to `_ga`.
60
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
61
+ */
32
62
'cookie_prefix' ?: string ;
63
+ /**
64
+ * If set to true, will update cookies on each page load.
65
+ * Defaults to true.
66
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
67
+ */
33
68
'cookie_update' ?: boolean ;
69
+ /**
70
+ * Appends additional flags to the cookie when set.
71
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
72
+ */
34
73
'cookie_flags' ?: string ;
74
+ /**
75
+ * If set to false, disables all advertising features with gtag.js.
76
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/display-features
77
+ */
35
78
'allow_google_signals?' : boolean ;
79
+ /**
80
+ * If set to false, disables all advertising personalization with gtag.js.
81
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/display-features
82
+ */
36
83
'allow_ad_personalization_signals' ?: boolean ;
84
+ /**
85
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-link-attribution
86
+ */
37
87
'link_attribution' ?: boolean ;
88
+ /**
89
+ * If set to true, anonymizes IP addresses for all events.
90
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization
91
+ */
38
92
'anonymize_ip' ?: boolean ;
93
+ /**
94
+ * Custom dimensions and metrics.
95
+ * See https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets
96
+ */
39
97
'custom_map' ?: { [ key : string ] : unknown } ;
40
98
[ key : string ] : unknown ;
41
99
}
@@ -45,6 +103,9 @@ export interface GtagConfigParams {
45
103
* @public
46
104
*/
47
105
export interface AnalyticsOptions {
106
+ /**
107
+ * Params to be passed in the initial gtag config call during analytics initialization.
108
+ */
48
109
config : GtagConfigParams | EventParams ;
49
110
}
50
111
@@ -91,6 +152,7 @@ export interface SettingsOptions {
91
152
export interface CustomParams {
92
153
[ key : string ] : unknown ;
93
154
}
155
+
94
156
/**
95
157
* Type for standard gtag.js event names. `logEvent` also accepts any
96
158
* custom string and interprets it as a custom event name.
@@ -126,12 +188,14 @@ export type EventNameString =
126
188
| 'view_search_results' ;
127
189
128
190
/**
191
+ * Standard analytics currency type.
129
192
* @public
130
193
*/
131
194
export type Currency = string | number ;
132
195
133
196
/* eslint-disable camelcase */
134
197
/**
198
+ * Standard analytics `Item` type.
135
199
* @public
136
200
*/
137
201
export interface Item {
0 commit comments