Collecting user identity


Collecting user identity

At least once per session, the credentials of the logged-in user must be transmitted. To do this, there are two user data that can be used:

  • logged in user's email
  • your internal user identifier if it was communicated in the refId property of the contacts

Info

Internal user identifier corresponds to the refId property (Contact ID field of the contact editing interface)

# Use of user email

The code below is used to collect a user identification event:

curl -G --location \
--request POST 'https://collect.skalin.io/hit' \
--data-urlencode 'rec=1' \
--data-urlencode 'action=ui' \
--data-urlencode 'client_id={{ClientId}}' \
--data-urlencode 'customer_id={{CustomerId}}' \
--data-urlencode 'event_id={{EventId}}' \
--data-urlencode 'visitor_id={{VisitorId}}' \
--data-urlencode 'visit_id={{VisitId}}' \
--data-urlencode 'localtime={{LocalTime}}' \
--data-urlencode 'identity={"email":"{{UserEmail}}"}' \
--data-urlencode 'url={{Url}}' \
--data-urlencode 'cip={{Cip}}'
1
2
3
4
5
6
7
8
9
10
11
12
13

With NodeJS and axios (opens new window) library

axios({
  method: 'POST',
  url: 'https://collect.skalin.io/hit',
  headers: {
    'Cache-Control': 'no-cache'
  },
  params: {
    rec: 1,
    action: 'ui',
    client_id: '{{ClientId}}',
    customer_id: '{{CustomerId}}',
    event_id: '{{EventId}}',
    visitor_id: '{{VisitorId}}',
    visit_id: '{{VisitId}}',
    localtime: '{{LocalTime}}',
    identity: {"email":"{{UserEmail}}"},
    url: '{{Url}}',
    cip: '{{Cip}}'
  }
});

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ClientId

your client ID which was provided to you by Skalin or is available in the Settings> General section

CustomerId (optional) customer identifier or customer domain name (the CustomerId is only useful if the same contact can connect to several entities with the same identifier)
EventId (optional / auto-generated) Event's unique identifier of 16 characters. Allows you to manage de-duplication (The last transmitted will be kept).
VisitorId Contact / visitor's unique identifier. 16 character uid
VisitId Visit or session's unique identifier. 16 character uid (used to count visits. If VisitId is not filled in or is different for each call, each call will be counted as a new visit).
LocalTime (optional) User's localtime (`08:00:05`)
UserEmail Logged user's email already referenced in Skalin
Url (optional) Feature's url on your platform
Cip (optional) User's ip

Info

CustomerId corresponds to the refId API's property (Customer ID field of the customer editing interface)

# Use of your user ID

The code below is used to collect a user identification event:

curl -G --location \
--request POST 'https://collect.skalin.io/hit' \
--data-urlencode 'rec=1' \
--data-urlencode 'action=ui' \
--data-urlencode 'client_id={{ClientId}}' \
--data-urlencode 'customer_id={{CustomerId}}' \
--data-urlencode 'event_id={{EventId}}' \
--data-urlencode 'visitor_id={{VisitorId}}' \
--data-urlencode 'visit_id={{VisitId}}' \
--data-urlencode 'localtime={{LocalTime}}' \
--data-urlencode 'identity={"id":"{{UserId}}"}' \
--data-urlencode 'url={{Url}}' \
--data-urlencode 'cip={{Cip}}'
1
2
3
4
5
6
7
8
9
10
11
12
13

With NodeJS and axios (opens new window) library

axios({
  method: 'POST',
  url: 'https://collect.skalin.io/hit',
  headers: {
    'Cache-Control': 'no-cache'
  },
  params: {
    rec: 1,
    action: 'ui',
    client_id: '{{ClientId}}',
    customer_id: '{{CustomerId}}',
    event_id: '{{EventId}}',
    visitor_id: '{{VisitorId}}',
    visit_id: '{{VisitId}}',
    localtime: '{{LocalTime}}',
    identity: {"id":"{{UserId}}"},
    url: '{{Url}}',
    cip: '{{Cip}}',
    ts: '{{ts}}'
  }
});

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ClientId

your client ID which was provided to you by Skalin or is available in the Settings> General section

CustomerId (optional) customer identifier or customer domain name (the CustomerId is only useful if the same contact can connect to several entities with the same identifier)
EventId (optional / auto-generated) Event's unique identifier of 16 characters. Allows you to manage de-duplication (The last transmitted will be kept).
VisitorId Contact / visitor's unique identifier. 16 character uid
VisitId Visit or session's unique identifier. 16 character uid (used to count visits. If VisitId is not filled in or is different for each call, each call will be counted as a new visit).
LocalTime (optional) User's localtime (`08:00:05`)
UserId Logged user's ID already referenced in Skalin
Url (optional) Feature's url on your platform
Cip (optional) User's ip
ts (optional) event timespan with YYYY-MM-DDTHH:mm:ss format (By default, timespan is initialized with current server time)

Info

CustomerId corresponds to the refId API's property (Customer ID field of the customer editing interface)

Contributors: Julien