Classes
Constants
- CATEGORY_LABELS :
Object.<TrackingCategory, string>
Typedefs
- FetchResult :
object - MockFetch ⇒
Promise.<FetchResult> - GAOptions :
object
GA4
Kind: global class
Implements: IAnalyticsStorage
new GA4(options)
| Param | Type |
|---|---|
| options | GAOptions |
gA4._logger : IGALogger
Kind: instance property of GA4
gA4.setDefaultLogger(logger)
Kind: instance method of GA4
| Param | Type |
|---|---|
| logger | IGALogger |
gA4.createUserSession(pageId, senderId, sessionId, [metadata], [ts], [nonInteractive]) ⇒ Promise
Kind: instance method of GA4
| Param | Type | Default |
|---|---|---|
| pageId | string | |
| senderId | string | |
| sessionId | string | |
| [metadata] | SessionMetadata | |
| [ts] | number | |
| [nonInteractive] | boolean | false |
gA4.storeEvents(pageId, senderId, sessionId, events, [user], [ts]) ⇒ Promise
Kind: instance method of GA4
| Param | Type | Default |
|---|---|---|
| pageId | string | |
| senderId | string | |
| sessionId | string | |
| events | Array.<Event> | |
| [user] | GAUser | |
| [ts] | number |
GA4
Kind: global class
new GA4(options)
| Param | Type |
|---|---|
| options | GAOptions |
gA4._logger : IGALogger
Kind: instance property of GA4
gA4.setDefaultLogger(logger)
Kind: instance method of GA4
| Param | Type |
|---|---|
| logger | IGALogger |
gA4.createUserSession(pageId, senderId, sessionId, [metadata], [ts], [nonInteractive]) ⇒ Promise
Kind: instance method of GA4
| Param | Type | Default |
|---|---|---|
| pageId | string | |
| senderId | string | |
| sessionId | string | |
| [metadata] | SessionMetadata | |
| [ts] | number | |
| [nonInteractive] | boolean | false |
gA4.storeEvents(pageId, senderId, sessionId, events, [user], [ts]) ⇒ Promise
Kind: instance method of GA4
| Param | Type | Default |
|---|---|---|
| pageId | string | |
| senderId | string | |
| sessionId | string | |
| events | Array.<Event> | |
| [user] | GAUser | |
| [ts] | number |
ResponseFlag : enum
Kind: global enum
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| DISAMBIGUATION_SELECTED | string | "d" | Disambiguation quick reply was selected |
| DISAMBIGUATION_OFFERED | string | "o" | Disambiguation occured - user was asked to choose the right meaning |
| DO_NOT_LOG | string | "!" | Do not log the event |
| HANDOVER | string | "h" | Handover occurred |
TrackingType : enum
Kind: global enum
Properties
| Name | Type | Default |
|---|---|---|
| CONVERSATION_EVENT | string | "conversation" |
| TRAINING | string | "train" |
| PAGE_VIEW | string | "page_view" |
| REPORT | string | "report" |
TrackingCategory : enum
TrackingCategory
Kind: global enum
Properties
| Name | Type | Default |
|---|---|---|
| PAGE_VIEW_FIRST | string | "pf" |
| PAGE_VIEW_SUBSEQUENT | string | "pp" |
| STICKER | string | "sti" |
| IMAGE | string | "img" |
| LOCATION | string | "loc" |
| ATTACHMENT | string | "att" |
| TEXT | string | "txt" |
| QUICK_REPLY | string | "qr" |
| OPT_IN | string | "oin" |
| REFERRAL | string | "ref" |
| POSTBACK_BUTTON | string | "btn" |
| URL_LINK | string | "url" |
| OTHER | string | "oth" |
| HANDOVER_TO_BOT | string | "bot" |
| INTENT_DETECTION | string | "int" |
| DISAMBIGUATION_SELECTED | string | "dis" |
| DISAMBIGUATION_OFFERED | string | "dio" |
| REPORT_FEEDBACK | string | "fdb" |
| HANDOVER_OCCURRED | string | "hum" |
CATEGORY_LABELS : Object.<TrackingCategory, string>
Kind: global constant
FetchResult : object
Kind: global typedef
| Param | Type |
|---|---|
| status | number |
| [statusText] | string |
| json | Promise.<object> |
MockFetch ⇒ Promise.<FetchResult>
Kind: global typedef
| Param | Type |
|---|---|
| url | string |
| [options] | RequestInit |
GAOptions : object
Kind: global typedef
Properties
| Name | Type |
|---|---|
| measurementId | string |
| apiSecret | string |
| [debug] | boolean |
| [log] | IGALogger |
| [fetch] | MockFetch |