This preview of pull request 1639 is meant for internal use only.

Freshsales Destination

Freshsales quick info

Freshsales accepts Track, Page, and Identify calls. If you reference it in the Integrations object, call it “Freshsales”.

Freshsales accepts cloud-mode data from all Segment source types. It does not offer device-mode connections.

This destination is maintained by Freshsales. For any issues with the destination contact us at support@freshsales.io.

Getting Started

You can create and update Freshsales Leads and Contacts through Segment. We support identify, page, and track methods.

Once your Segment source starts receiving data, you can send them to Freshsales by enabling this destination. You can enable it from Freshsales Admin Settings for Third Party Integrations. Select the Segment source from which data has to be forwarded to Freshsales.

You can also enable Freshsales destination from Segment destinations dashboard. You will have to provide the subdomain of your Freshsales Account and an admin API key.

Identify

You can use identify to create a lead or a contact when a website visitor fills a webform. When you identify a user, we’ll pass that user’s information to Freshsales.

User ID

userId is a mandatory field which is used to identify the lead or contact in Freshsales. If your user identifier is not email, then email has to be a part of traits.

{
  "userId": "97980cfea0067",
  "traits": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "cfAlternateNumber": "98765432",
    "company": {
      "name": "Example.com"
    }
  }
}

By default, every identity is created as a lead. If you’d like an identity to be a contact, you’d need to pass fs_contact as true as a part of traits.

{
  "userId" : "97980cfea0067",
  "traits" : {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "fsContact": "true",
    "cfAlternateNumber": "98765432",
    "company": {
      "name": "Example.com"
    }
  }
}

Traits

traits are pieces of information you know about a user that are included in an identify method.

Default Traits

Segment has reserved some traits that have semantic meanings for users. You should only use reserved traits for their intended meaning. Check the Segment Spec to get a list of reserved traits.

Default Traits

All attributes that are a part of traits should correspond to the internal names of those fields in Freshsales. Attributes that are not mapped with their corresponding fields are ignored.

However, we make exception to two attributes title and phone that are part of default traits. They are automatically mapped to Freshsales attributes job_title and work_number respectively.

Custom Traits:

As part of traits, you can send custom fields created in Freshsales by using their internal names in camel case. You can find internal names in corresponding field settings page. Also, custom fields will not be automatically created. You have to create them in Freshsales before proceeding to send data from Segment. To learn more about creating custom fields in Freshsales check this link.

Custom Traits

Objects:

Accounts and Deals associated to a contact or lead can also be updated in Freshsales. The objects company and deal in the identity correspond to the Accounts and Deals in Freshsales. You can pass the traits of the company or the deal along with the respective objects in the identity.

{
  "userId" : "97980cfea0067",
  "traits" : {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "fsContact": "true",
    "company": {
      "name": "Example.com"
    },
    "deal" :{
      "name" : "Sample Deal",
      "amount": 1234
    }
  }
}

Track

You can track activities of your website visitors. If a user is subscribing to a newsletter and you want to track it, use track method to accomplish that. When you track an event, we will send that event to Freshsales.

Track request payload

{
  "userId" : "john.doe@example.com",
  "event": "Email Bounced",
  "properties" : {
    "emailId": "110688",
    "emailSubject": "Welcome to Example.com",
    "campaignId": "123",
    "campaignName": "New Customer Discount"
  }
}

Segment has standardized a series of reserved event names that have special semantic meaning. We map these events to tools that support them whenever possible. See the Semantic Events docs for more detail. Also, custom events are supported.

Page

If a user is visiting your web pages and you want to track it, then use page method to do that. When you call a page event, we send a pageview to Freshsales. You can send extra pieces of information as part of properties. See the reserved properties for more detail.

Sample Page request payload

{
  "userId" : "john.doe@example.com",
  "name": "Page view",
  "properties" : {
    "title": "Welcome to pricing page | Example.com",
    "url" : "http://example.com/pricing"
  }
}

Troubleshooting

Custom Fields Aren’t Updating

Make sure that the traits you’re passing through match the custom field’s internal name and data type.

Personas

You can send computed traits and audiences generated using Segment Personas to this destination as a user property. To learn more about Personas, contact us for a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Personas sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Personas sets that value to false.

When you first create an audience, Personas sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Supported Sources and Connection Modes

Before you start, make sure Freshsales supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.

Web Mobile Server
📱 Device-mode ⬜️ ⬜️ ⬜️
☁️ Cloud-mode

Segment offers an optional Device-based Connection Mode for Mobile data going to Freshsales, so that you can use Freshsales features that collect data directly from the mobile device. To do this, you must package the Segment-Freshsales mobile SDK with the Segment mobile library.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

API token

You can find your Freshsales API token on the Integrations page under Profile Settings -> API Settings.

Freshsales subdomain

Provide the subdomain of your Freshsales account. So if your domain is segment.freshsales.io, then your subdomain is ‘segment’.

This page was last modified: 22 Nov 2019



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account