Class: SegmentAnalyticsService

Analytics.SegmentAnalyticsService()

new SegmentAnalyticsService()

Implements:
  • AnalyticsService
Source:

Methods

checkIdentifyCalled()

Checks that identify was first called. Otherwise, logs error.

Source:

identifyAnonymousUser(traitsopt) → {Promise}

Send anonymous identify call to Segment's identify.

Parameters:
Name Type Attributes Description
traits * <optional>
Source:
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>
Source:

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>
Source:

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>
Source:

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)

Source:
Returns:

The promise returned by HttpClient.post.

Type
Promise