Registration

This is an example of a Registration event:

sd.track('registration', {
    email: '[email protected]',
    username: 'joesmith',
    userId: '97980cfea0067',
    optIn: true,
    firstName: 'Joe',
    lastName: 'Smith',
    name: 'Joe Smith',   
    properties: {
          campaignId: '12345'
    }
});

Track when users first register or sign up using the track command with the registration event type. Details about the registration are added in an eventObject.

When a user registers with you for the first time, you should call identify and separately also call registration.

Value

Type

Required

Description

email

String

Yes

The email address of the user (e.g. [email protected]).

username

String

No

The username (e.g. joesmith).

userId

String

No

The user id. (e.g. 97980cfea0067).

optIn

Boolean

No

A boolean flag indicating whether this contact has opted in to receive marketing email.

firstName

String

No

The first name of the user (e.g. Joe).

lastName

String

No

The last name of the user (e.g. Smith).

name

String

No

The full name of the user. (e.g. Joe Smith).

properties

Object

No

An object of extra arguments (e.g. { campaignId: '12345' }).


Authentication

This is an example of an Authentication event:

sd.track('authentication', {
  userId: 'xyz123456',
  isLoggedIn: true,
  ARN: 'arn:aws:sns:us-east-1:123456789:example-arn-2',
  email: '[email protected]',
  properties: {
    appVersion: '3.4.1'
  }
});

📘

When to use 'identify' vs. 'authentication'

The general method to establish the identity for users is to use the identify call. The authentication event is mainly useful when using Amazon SNS as a channel for push messaging. It is used tie an ARN identifier with the userId. Always use identify except to specifically provide an ARN.

An authentication event should be called when a user logs in or out of the service. This is a track event with the authentication event type. Details about the product are added in added in an eventObject.

Value

Type

Required

Description

userId

String

Yes

The unique userId of the user authenticating

isLoggedIn

Boolean

Yes

A flag indicating if the user is logging into the system. This should be false.

ARN

String

Yes

The Amazon AWS ARN the of the user.

email

String

No

The email address of the user authenticating.

properties

Object

No

An object of extra arguments.