Skip to main content

Get User Data into Candu

Bring user attributes and events to Candu using webhooks, Segment.com, or REST API. Enable segmentation and personalization based on user properties and behavior.

Deborah Ramírez avatar
Written by Deborah Ramírez
Updated yesterday

Send user data from your systems into Candu to personalize content based on user attributes and behavior. With user data in Candu, you can:

  • Show different content to different users: Display premium features only to paid customers, or onboarding checklists to new users

  • Target by user properties: Segment by role, plan type, company size, or custom attributes

  • Personalize based on behavior: Show content based on feature usage, onboarding progress, or product milestones

Need to export data from Candu via webhooks? See Export Candu Data via Webhooks

Before you start

You must identify users with a unique ID (such as a user ID from your database or their email address). Without this, users will be tracked anonymously and segmentation won't work.

What data can you bring to Candu?

User or group traits (attributes that describe the user or group):

  • Email, role type, plan type, company name

  • Custom attributes specific to your product

User events (actions users take):

  • Completed onboarding steps

  • Feature usage milestones (e.g., "Invited team member")

  • Custom events from your application

Note: To create user segments, an identify event with traits is required. Tracking events with properties will not be sufficient.

How to Bring Data to Candu

Choose the method that works best for your team:

Option 1: JavaScript SDK (Installation Script)

A common option to get your user data into Candu is sending it directly via the installation script.

1. Add your user ID

You must send Candu your userId (unique ID or email address) so we can identify your users. To do that, you must specify a userId parameter in Candu's installation script.

Example init script:

<script>
(function(d, params){
var script = d.createElement('script');
script.setAttribute('src', 'https://cdn.candu.ai/sdk/latest/candu.umd.js?token=' + params.clientToken);
script.onload = function () { Candu.init(params); }
d.head.appendChild(script);
})(document, {
clientToken: 'YOUR_CLIENT_TOKEN',
userId: 'YOUR_USER_ID',
});

2. Add user traits

You can then pass through the data:

  • Any user traits about your users such as email, role type, plan type, and company name

  • Any user events such as completion of key product actions like "Invited team member"

You will be able to use this data for segmentation and personalization.

User traits example:

<script>
(function(d, params){
var script = d.createElement('script');
script.setAttribute('src', 'https://cdn.candu.ai/sdk/latest/candu.umd.js?token=' + params.clientToken);
script.onload = function () { Candu.init(params); }
d.head.appendChild(script);
})(document, {
clientToken: 'YOUR_CLIENT_TOKEN',
userId: 'YOUR_USER_ID',

// ADD ANY TRAITS IN THE OBJECT BELOW
traits: { email: 'YOUR_CUSTOMER_EMAIL@example_domain.ai' },
});
</script>

Reserved traits Candu has standardized:

Trait

Type

Description

email

String

Email address of a user. Please make sure to send the email through with a lowercase 'e'.

To see all the options available when initializing Candu, see JavaScript API.

3. Send user events

You can pass user events by calling the window.Candu.getEventing() method in the Candu singleton. For full details, see JavaScript API.

Option 2: Segment.com Integration

This integration sends user event data via Segment.com to Candu.

Setup

If you use Segment.com to send Candu user event data, you must send it as identify calls with user traits:

analytics.identify("some_user_id", { 
name: "Some Person",
email: "[email protected]",
logins: 5
});

For more information on installing Segment, please refer to the Segment.com section in the Candu Destination documentation.

Tip: We recommend setting up Signed Identities in Candu to improve data security.

Option 3: REST API Webhooks

Send user data directly to Candu's REST API from your backend systems.

Get started: See our REST API webhooks documentation for endpoint details, authentication, and payload examples.

Troubleshooting

User traits aren't appearing in Candu

  • JavaScript SDK: Verify the script is loading correctly (Use Candu.providerProps in the browser's console to confirm)

  • Segment.com: Confirm the Candu destination is enabled and identify calls are being sent

  • REST API: Check API response codes for errors

  • Check that trait names don't have typos (especially email with lowercase 'e')

Did this answer your question?