Customers
Customers represent the end-user accounts on your platform. Foir tracks customer identity, profile data, activity, and segment membership to power personalization and experiments.
Overview
A customer is an end-user account — someone who visits your site, logs in, and interacts with your content. Foir maintains customer records with:
- Identity: email, authentication status, account creation date
- Profile: custom schema-driven profile data you define
- Activity: content resolution history, segment memberships, experiment assignments
- Status: active, inactive, or suspended
Customers are central to personalization. Segment rules evaluate against customer attributes and behavior, experiments assign customers to variant groups, and targeting rules can check authentication status.
In the Admin
Managing Customers
- Go to Customers in the admin dashboard
- Browse the customer list with columns for email, status, last login, and creation date
- Click a customer to view their detail page
Customer Detail
The customer detail page shows:
- Account information: email, status, email verification, creation date, last login
- Segment memberships: which segments the customer belongs to and when they entered
- Experiment assignments: active experiments and assigned variants
- Activity log: recent content resolution events, including markets, devices, and locales used
- Profile data: custom profile fields you have configured
Customer Profiles
Profiles let you store custom data on each customer using a schema you define.
Defining the Profile Schema
- Go to Settings > Customer Profiles
- Define fields for your schema (e.g.,
firstName,companyName,tier) - Each field has a key, display name, and type
- Save the schema
Setting Profile Data
- Open a customer’s detail page
- Navigate to the Profile tab
- Fill in or update the profile fields
- Save
Profile data is available in segment rules and can be used to drive personalization.
Via the CLI
Customer Management
# List all customers
foir customers list
# Get a customer by ID or email
foir customers get <id>
foir customers get customer@example.com
# Create a customer
foir customers create --data '{
"email": "newcustomer@example.com",
"password": "securepassword123"
}'
# Delete a customer
foir customers delete <id>Customer Profiles
# View the current profile schema
foir customer-profiles schema
# Update the profile schema (define custom fields)
foir customer-profiles update-schema --data '[
{ "key": "firstName", "name": "First Name", "type": "text" },
{ "key": "companyName", "name": "Company", "type": "text" },
{ "key": "tier", "name": "Customer Tier", "type": "select", "options": ["free", "pro", "enterprise"] }
]'
# Get a customer's profile data
foir customer-profiles get <customerId>
# Set profile data for a customer
foir customer-profiles set <customerId> --data '{
"firstName": "Jane",
"companyName": "Acme Corp",
"tier": "enterprise"
}'Via the API
Querying Customers
query GetCustomer {
customerByEmail(email: "jane@example.com") {
id
email
status
emailVerified
lastLoginAt
createdAt
}
}Customer Profile Data
query GetProfile {
customerProfile(customerId: "cust-123") {
customerId
data
updatedAt
}
}Customer-Scoped Records
Content records can be scoped to individual customers, allowing you to store per-customer content such as saved preferences, personalized landing pages, or customer-specific configurations. Records scoped to a customer are only returned when that customer is authenticated.
Best Practices
- Define a profile schema early — decide what custom data you need on customers before launch.
- Use email as a natural identifier — the CLI supports looking up customers by email directly.
- Monitor segment membership — check the customer detail page to verify customers land in the expected segments.
- Respect opt-outs — if customers opt out of segments, their preferences are honored regardless of rule evaluation.
- Clean up inactive accounts — use the status field to manage customer lifecycle.