Identify event

How to identify your users on Segment and send user properties to Palabra

Identifying users is the first step and one of the most important ones. With the 'Identify' action you are able to send Segment (and Palabra) your user's email address, first and last name, company name, and anything that matters to your business.

According to Segment's documentation, an 'Identify' event should be triggered when a user creates an account, logs in, or updates their profile.

So let's start by triggering an 'Identify' event after user's sign up.

Adding the Identify event on your app

For simplicity in this example we'll use a web-based app written in JS but that's not your only option. Segment supports many different platforms and languages.

Go to your frontend app and find the place where user's complete their sign-up. Here we'll want to run the identify method every time a user completes the sign-up successfully.

Once you found that file copy and paste the code below:

signup.js
// TODO: replace this data with the data of the user that just signed up.

window.analytics.identify("97980cfea0067", { // User ID: required by Palabra
  name: "Peter Gibbons",
  email: "peter@example.com", // required by Palabra
  plan: "premium",
  logins: 5
});

Some things to notice:

  1. The object analytics is added to your page with the Segment script that you pasted in the head of your page.

  2. This script assumes that the object analytics already exists. You may want to check that before executing this method.

  3. The first argument in the function is the user ID. This should be your platform's user ID for identifying this user.

  4. The second argument is an object with a list of properties. The only property that's required by Palabra is email. You should include any properties that will be relevant for this user. For example, if you ask users for their company role when they sign up, you may add role: "[name of the role]" to this object.

Although Segment doesn't have required users properties, Palabra does, so make sure you are always sending:

  1. A user ID. Make sure you are using the same user ID when tracking user actions. More about this here.

  2. An email. Palabra uses email addresses to identify users, so make sure you are sending one.

Other places where you should execute the identify method

As Segment's documentation suggests, you should execute this event after users create an account, log in or update their profile, so make sure that you are doing so.

Now that you identified your users, you are ready to start tracking their actions.

Last updated