new SegmentAnalyticsService()
- Implements:
- AnalyticsService
- Source:
Methods
checkIdentifyCalled()
Checks that identify was first called. Otherwise, logs error.
identifyAnonymousUser(traitsopt) → {Promise}
Send anonymous identify call to Segment's identify.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
traits |
* |
<optional> |
Returns:
Promise that will resolve once the document readyState is complete
- Type
- Promise
identifyAuthenticatedUser(userId, traitsopt)
- Send identify call to Segment.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | ||
traits |
* |
<optional> |
sendPageEvent(nameopt, categoryopt, propertiesopt)
Sends a page event to Segment and downstream.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
* |
<optional> |
If only one string arg provided, assumed to be name. |
category |
* |
<optional> |
Name is required to pass a category. |
properties |
* |
<optional> |
sendTrackEvent(eventName, propertiesopt)
Sends a track event to Segment and downstream. Note: For links and forms, you should use trackLink and trackForm instead.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eventName |
* | ||
properties |
* |
<optional> |
sendTrackingLogEvent(eventName, properties) → {Promise}
Logs events to tracking log and downstream. For tracking log event documentation, see https://openedx.atlassian.net/wiki/spaces/AN/pages/13205895/Event+Design+and+Review+Process
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | (event_type on backend, but named to match Segment api) |
properties |
Object | (event on backend, but named properties to match Segment api) |
Returns:
The promise returned by HttpClient.post.
- Type
- Promise