# Personalized Offers Object ✨

Early Access

The Personalized Offers feature is in early access. To request access, visit this page in Chargebee Billing (opens new window).

Previous Version

The earlier version of Personalized Offers was delivered via Retention.js, which has since been deprecated. You can still view the documentation (opens new window) for reference.

A Personalized Offers instance can be used to dynamically display eligible offers (opens new window) to the user.

Create a personalizedOffers object using the chargebee object to use the functions listed below.

# Initialize personalized offers

# init()

Initializes the personalized offers experience and displays eligible offers to the user.

Chargebee detects the pages visited by the user and dynamically displays eligible offers that have been pre-configured in the Retention dashboard.

# Example

personalizedOffers.init({
  account: {
    customerId: "16CRibUdE6pV6HoU"
  },
  externalUserId: "jane_doe",
  roles: ['sales-manager'],
  locale: "fr-FR",
  custom: {
    viewCount: 6
  }
});
1
2
3
4
5
6
7
8
9
10
11

# Parameters

account
Object Required View properties
Details about the customer.
subcription
Object Required if multiple brands are configured in the Growth dashboard. View properties
Details about the specific subscription of the customer for which to display the offer.
firstName
String
The first name of the logged-in user. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
lastName
String
The last name of the logged-in user. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
fullName
String
The full name of the logged-in user. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
email
String
The email address of the logged-in user or the organization's primary contact. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
externalUserId
String
The logged-in user's unique ID in your system. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
roles
Array<String>
A list of roles that the logged-in user has in your application. For example: ['admin'], ['sales-rep','sales-manager']. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.
locale
String

The user's locale (for example, en-US, fr-FR). Chargebee matches this value against the language matching rules configured in the Chargebee Growth dashboard and displays the offer in the matching language. If you omit this parameter, Chargebee matches the browser language instead. If no rule matches, Chargebee displays the offer in your site's primary language, which is English.

Requires multi-language support; contact the Chargebee Support to enable it for your site. Until then, Chargebee ignores this parameter. To configure languages, add each language and its matching rules under Settings > Languages in the Chargebee Growth dashboard, then add the translations for each language while setting up offers.

custom
Object
An object containing one or more custom fields defined in the Chargebee Retention dashboard. Ignored if it is not mapped to a field in the Chargebee Retention dashboard.

# Returns

None.