Skip to content

Commit 3943346

Browse files
committed
Add some documentation
1 parent 7f09d08 commit 3943346

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

packages-exp/analytics-exp/src/public-types.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,77 @@ import { FirebaseApp } from '@firebase/app-exp';
2323
* @public
2424
*/
2525
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+
*/
2632
'send_page_view'?: boolean;
33+
/**
34+
* The title of the page.
35+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
36+
*/
2737
'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+
*/
2842
'page_path'?: string;
43+
/**
44+
* The URL of the page.
45+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
46+
*/
2947
'page_location'?: string;
48+
/**
49+
* Defaults to `auto`.
50+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
51+
*/
3052
'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+
*/
3157
'cookie_expires'?: number;
58+
/**
59+
* Defaults to `_ga`.
60+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
61+
*/
3262
'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+
*/
3368
'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+
*/
3473
'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+
*/
3578
'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+
*/
3683
'allow_ad_personalization_signals'?: boolean;
84+
/**
85+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-link-attribution
86+
*/
3787
'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+
*/
3892
'anonymize_ip'?: boolean;
93+
/**
94+
* Custom dimensions and metrics.
95+
* See https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets
96+
*/
3997
'custom_map'?: { [key: string]: unknown };
4098
[key: string]: unknown;
4199
}
@@ -45,6 +103,9 @@ export interface GtagConfigParams {
45103
* @public
46104
*/
47105
export interface AnalyticsOptions {
106+
/**
107+
* Params to be passed in the initial gtag config call during analytics initialization.
108+
*/
48109
config: GtagConfigParams | EventParams;
49110
}
50111

@@ -91,6 +152,7 @@ export interface SettingsOptions {
91152
export interface CustomParams {
92153
[key: string]: unknown;
93154
}
155+
94156
/**
95157
* Type for standard gtag.js event names. `logEvent` also accepts any
96158
* custom string and interprets it as a custom event name.
@@ -126,12 +188,14 @@ export type EventNameString =
126188
| 'view_search_results';
127189

128190
/**
191+
* Standard analytics currency type.
129192
* @public
130193
*/
131194
export type Currency = string | number;
132195

133196
/* eslint-disable camelcase */
134197
/**
198+
* Standard analytics `Item` type.
135199
* @public
136200
*/
137201
export interface Item {

0 commit comments

Comments
 (0)