Setup the segmentation

Learn how to push attributes to create user segments in Jimo.

Understanding User Attributes

User segmentation in Jimo allows you to display experiences, publish posts or target analytics based on specific user data. You can push attributes dynamically to personalize interactions and optimize engagement.

As an example, you can publish a post for only new users or paying customers or any other custom data you find relevant to segment with.

Jimo supports three types of attributes:

  1. User Identification (identify)

    • Used to differentiate users by assigning them a unique userId.

    • Ensures each user is uniquely recognized across sessions and devices.

    window.jimo.push(['do', 'identify', ["123456"]]);
  2. Default Jimo Attributes (user:email, user:name, etc.)

    • Used to populate predefined user data fields in Jimo.

    • Can only update existing fields (e.g., name, email, language).

    window.jimo.push(["set", "user:name", ["John Doe"]]);
    window.jimo.push(["set", "user:email", ["[email protected]"]]);
  3. Custom Attributes (user:attributes)

    • Allows you to create your own fields and values to enhance segmentation.

    • Can store strings, numbers, arrays, and booleans (up to 700 characters per attribute).

    window.jimo.push(["set", "user:attributes", [{ plan: "Pro", isSubscribed: true }]]);

Setup Custom Attributes

To start using custom attributes in segmentation, follow these steps:

  1. Load the Snippet

  2. Fetch User Data

    • Fetch your user data that you want to use as custom attributes.

  3. Set Custom Attributes

    • Pass the data to Jimo by using the window.jimo.push(["set", "user:attributes", [object, boolean /* refetchBoosted */] ]) method.

    • Note: The objects allowed in the custom attributes are only strings, numbers, arrays and booleans.

    • For more details on how to use the setAttributes SDK method, refer to How to Use the Set Attributes SDK Method.

Example Code

Here's an example of setting custom attributes and using them for segmentation:

// Example 1: Set the attribute foo and bar
window.jimo.push([ "set", "user:attributes", [ {foo : "hello", bar: "world" } ] ])

// Example 2: Set the attribute foo and bar and refetch boosted posts
window.jimo.push([ "set", "user:attributes", [ {foo : "hello", bar: "world" }, true ]])

Understanding Segmentation

Why Use Custom Attributes?

Jimo provides default attributes (e.g., name, email, language, and activity data), but these are limited to basic user metadata and activity tracking only on pages where Jimo is installed. However, real-world segmentation often requires custom data from your own infrastructure to define specific groups of users based on internal business logic and Jimo doesn’t automatically have access to deeper user data that might be critical for targeting, personalization, or monitoring.

Why Extend Jimo’s Default Attributes?

Better Targeting & Personalization Jimo can only segment users based on what it knows—such as experience interactions or basic identity. However, businesses often need specific conditions based on internal user data, like:

  • Subscription plans (Free, Pro, Enterprise)

  • Internal permissions (Admin, Editor, Viewer)

  • Last purchase date or engagement scores By pushing these attributes, you can create tailored experiences for different user cohorts.

Flexible Segmentation Based on Business Data Jimo can only track events from when it was installed. This means:

  • If a user signed up before Jimo was implemented, there’s no record of their signup date unless you push it as an attribute.

  • If you want to filter users based on payment history, Jimo cannot access your billing system—but you can push a last_payment_date attribute.

  • Jimo can track the last time a user visited a page, but if you want to track feature usage or customer lifecycle stages, pushing custom attributes is necessary.

Improved Debugging & Monitoring If you need better insights into technical issues, attributes like:

  • Device & OS: Helps debug experience rendering issues.

  • Browser type: Identifies compatibility problems.

  • Time zone & localization: Ensures experiences are displayed at the right time and in the correct language.

Differentiate Workflows & User Configurations Not all users have the same setup. If your product has multiple workflows or permissions, pushing attributes like:

  • Enabled features (A/B tests, beta access)

  • User-defined settings (e.g., dark mode, accessibility preferences)

  • Region-specific conditions (e.g., compliance restrictions, geofencing) … can ensure that Jimo experiences adapt dynamically to different users.

Here are key custom attributes that we recommend setting up to extend segmentation and personalize experiences:

1. User Profile & Subscription Details

These attributes help define who the user is within your system.

Attribute Name

Example Values

Use Case

plan

"Free", "Pro", "Enterprise"

Target features based on subscription level

user_role

"Admin", "Editor", "Viewer"

Adjust permissions for team members

permissions

["edit", "publish"]

Enable/disable specific actions per user

2. Engagement & Activity Tracking

Jimo tracks activity only after installation—pushing internal data allows for more precise user tracking, on events prior to Jimo install.

Attribute Name

Example Values

Use Case

signup_date

"2023-06-01T00:00:00Z"

Target only users who signed up before/after a date

last_active_days

15

Segment inactive users for re-engagement

feature_usage

["dashboard", "reports"]

Trigger hints based on feature adoption

3. Technical & Debugging Information

These attributes improve monitoring and troubleshooting.

Attribute Name

Example Values

Use Case

browser

"Chrome", "Firefox"

Debug experience display issues

os

"Windows", "MacOS"

Identify OS-specific rendering problems

timezone

"UTC+2"

Optimize scheduling for experience delivery

4. Localization & User Preferences

Ensure experiences are personalized based on user settings.

Attribute Name

Example Values

Use Case

language

"fr", "en"

Serve experiences in the correct language

notifications_enabled

true/false

Enable/disable push notifications

preferred_theme

"light", "dark"

Adjust UI preferences dynamically


Example Code

Once you've defined which attributes to push, implement them using the Jimo SDK:

// Assign key user attributes to Jimo
window.jimo.push(["set", "user:attributes", { 
  plan: "Pro", 
  user_role: "Admin", 
  last_active_days: 15, 
  browser: "Chrome", 
  os: "Windows" 
}]);

Here’s a fully integrated example of how to set up user identification, assign default Jimo attributes, and push custom attributes for advanced segmentation.

// 1️⃣ Identify the user
window.jimo.push(["identify", {
  id: "user_12345"
}]);

// 2️⃣ Set default Jimo attributes
window.jimo.push(["set", "user", {
  name: "John Doe",
  email: "[email protected]"
}]);

// 3️⃣ Set custom attributes for segmentation
window.jimo.push(["set", "user:attributes", { 
  plan: "Pro",
  user_role: "Admin",
  permissions: ["edit", "publish"],
  signup_date: "2023-06-01T00:00:00Z",
  last_active_days: 12,
  browser: "Chrome",
  os: "MacOS",
  timezone: "UTC+2",
  notifications_enabled: true,
  preferred_theme: "dark"
}]);

This script should be added after Jimo is loaded on your website or app where your users login to ensure users are properly identified and categorized for targeted experiences.

// Identify the user and assign key user attributes to Jimo
window['jimo'].push([
  'do',
  'identify',
  [
    "b7b8c565-65a0-4dbd-8438-3b8c8773f49f", // Unique User ID
    () => {
      window['jimo'].push([
        'set',
        'user:email',
        ["[email protected]"] // Default Jimo attribute (User's email)
      ]);
      window['jimo'].push([
        'set',
        'user:name',
        ["Sam"] // Default Jimo attribute (User's name)
      ]);
      window['jimo'].push([
        'set',
        'core:language',
        ["en"] // Default Jimo attribute (User's preferred language)
      ]);
      window['jimo'].push([
        'set',
        'user:attributes',
        [
          {
            plan: "premium", // Custom attribute (Subscription plan)
            role: "admin", // Custom attribute (User role)
            last_activity: "2024-02-20T12:00:00Z", // Custom attribute (Last activity date)
            notifications_enabled: true, // Custom attribute (User's notifications status)
            browser: "Chrome", // Custom attribute (User's browser)
            timezone: "UTC+1" // Custom attribute (User's timezone)
          }
        ]
      ]);
    }
  ]
]);

Last updated

Was this helpful?