Event

The event method allows you to send events that happen on your site to Replay. The method expects an object with key/value pairs specifying information about the event as a parameter. Here is a basic example:

ReplayIo.event( {
    "event_name": "click",
    "properties": {
        "ip": "203.0.113.9",
        "extra": "additional settings"
    }
});
Property Type Description
event_name String A name for the event (e.g. “Signed Up”)
properties Object A dictionary of extra properties about an event

When you send an event using this method Replay automatically collects additional information about the event for you. The additional information includes a client ID, a session ID, and browser information (flash version, input encoding, screen resolution, etc.).

Trait

The trait method allows you to send user information to Replay. The method expects an object with key/value pairs specifying information about traits of the user as a parameter. Here is a basic example:

ReplayIo.trait( {
    "distinct_id": "abc",
    "properties": {
        "name": "John Brown",
        "age": "23",
        "gender": "male"
    }
});
Property Type Description
distinct_id String A distinct string that identifies the user (required)
properties Object A dictionary of extra traits of a user

Note: A trait call requires either a distinct_id or a previous call the to identify method.

Sending a trait using this method also results in Replay automatically collecting additional information for you (like it does for the event method).

Identify

The identify method allows you to tie one of your users and their actions to a unique distinct_id. The method expects a unique string representing the distinct_id of the user as the parameter. Here is a basic example:

ReplayIo.identify("abc");
Property Type Description
distinct_id String A distinct string that identifies the user (required)

Note: When you call the identify method without any arguments, it “unties” the user and their actions to a distinct_id.