Articles on: Integrations

How to Connect Crisp with Segment.com

Crisp provides a Segment.com integration, that is included in all our Essentials and Plus plans. The Segment integration lets you sync all your data from third-party sources to Crisp using Segment. Meaning Crisp is a destination.

Segment integration is available from the Crisp Essentials plan

Connect to your Crisp Dashboard



Go to app.crisp.chat > Plugins > Segment


Click “Connect to Segment”. You will be redirected, then select your workspace and source and click allow.


Crisp should be then able to receive data to Segment

Creating a contact on Crisp using Segment



To create a contact on Crisp using segment you need to use the Identify method. Here is an example:

analytics.identify('userId123', {
  name: 'John Doe',
  email: 'john.doe@segment.com',
  phone: '012346789',
  avatar: 'https://pbs.twimg.com/profile_images/834424630630817795/TfyS4uXb_400x400.jpg'
});


When you call identify, the name, email, avatar, and phone traits included in the call will be set to the current user in Crisp.

You can then see your contact using the Contact section on Crisp

A user was created with the data provided from Segment

Note that the email Trait is mandatory to create a Crisp contact.

Tracking events on a Crisp contact using segment



At this time, tracking Events has been disabled and is not available. Instead, use the Javascript SDK to push data and information about users.

To track events on a Crisp contact you need to use the Track method from the Segment SDK. An example call would look like:

analytics.track('Completed Purchase', {
  revenue: 42.99,
  shippingMethod: '2-day',
  category: 'Conversion'
});


This method is very similar to Event method from the Crisp JS SDK (https://help.crisp.chat/en/article/how-can-i-push-user-events-pxu9vm/)

You can see the Track events in the event section on Crisp

How to identify conversations



The segment integration identifies contacts & events, however as conversations are located on the Frontend the only way to identify conversations is by using this snippet:

analytics.on("identify", function(event, properties, options) {
  if (properties.email) {
    $crisp.push(["set", "user:email", properties.email]);
  }

  if (properties.name) {
    $crisp.push(["set", "user:nickname", properties.name]);
  }
});

Updated on: 04/11/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!