Adding Custom User Attributes for Segmentation

Custom attributes are a powerful way to segment your users inside of Frill and send targeted Announcements to different segments.

With our latest update, you can now include custom user attributes via the SSO token. Below is the format for passing this data:

$frillSSOKey = 'FILL_SSO_KEY';
$userData = [
  'email' => $user['email'],
  'id' => $user['id'],
  'name' => $user['name'],
  'attributes' => [
    'job_title' => 'Developer',
  ],
  'companies' => [
    [
      'id' => 1,
      'name' => 'Frill',
    ],
    [
      'id' => 2,
      'name' => 'Curator',
      'attributes' => [
         'monthly_spend' => 50
      ]
    ]
  ]
];

$frillUserToken = JWT::encode($userData, $frillSSOKey, 'HS256');

You can pass additional user attributes through the attributes field. For company-specific data, utilize the companies field.
Required Fields:
email: User's email address.
name: User's name.
companies.*.id: ID of the user's company (if applicable).
companies.*.name: Name of the user's company (if applicable).

Feel free to include any other relevant data within the  attributes field as needed.

Still need help? Contact Us Contact Us