The Frill Script

Custom user attributes for segmentation

Custom user attributes let you target surveys, announcements, and widgets to specific user segments—like showing a feature request board only to paid users or sending NPS surveys to customers above a certain MRR.

Before you begin: Custom attributes are available on Business plans and above. Check Settings > Company to confirm availability.

How it works

You pass custom data about users using an SSO Token, or with the Frill Script. These attributes become available as targeting filters when configuring widgets, surveys, and announcements.

Common use cases:

  • Show roadmaps only to users on paid plans

  • Send NPS surveys to high-value customers (MRR > $500)

  • Target announcements by user role (admin, editor, viewer)

  • Segment feedback by account tier or signup date

You must turn on the "Allow custom attributes when identifying users with JS" option from the Frill Script setup identification settings. If you're using SSO you will need to add the attributes as part of the token payload.

Adding user attributes

Add an attributes object inside the user object in your Frill Script:

window.Frill('container', {
  key: 'YOUR_CONTAINER_KEY',
  user: {
    email: '[email protected]',
    name: 'Jane Doe',
    attributes: {
      plan: 'business',
      mrr: 150,
      role: 'admin',
      signupDate: '2023-01-15'
    }
  }
});

You can pass any key-value pairs that make sense for your business. Frill treats them as strings, numbers, or booleans.

Company-level attributes

If you organize users by company or organization, pass company data in a companies array:

window.Frill('container', {
  key: 'YOUR_CONTAINER_KEY',
  user: {
    email: '[email protected]',
    name: 'Jane Doe',
    companies: [{
      id: 'acme-corp',
      name: 'Acme Corp',
      attributes: {
        plan: 'enterprise',
        mrr: 2500,
        employees: 150
      }
    }]
  }
});

This is useful for B2B apps where you want to target based on company characteristics, not individual user traits.

Using attributes for targeting

Once attributes are passed in the script, they appear in your Frill dashboard:

  1. Edit a widget, survey, or announcement

  2. Go to Targeting settings

  3. Under User Segments, you'll see your custom attributes

  4. Create rules like "plan equals business" or "mrr greater than 100"

Only users matching all targeting rules will see the feature.

Attributes are case-sensitive. Use consistent naming like plan, not Plan or PLAN.

Start with 3-5 attributes you'll actually use for targeting. You can always add more later as your segmentation needs grow.

Was this helpful?