Skip to main content


Optimizely Knowledge Base

Subjects and audiences in OpX

Every experiment has both subjects and audiences. The subject of an experiment is what you’re experimenting on. With OpX, an experiment’s subject can be Salesforce users or Salesforce records. An audience is a definition of which users will be included in your experiment.

Experiment subjects

If you use the Lightning Page Builder unmanaged package for your experiment, the subject will always be Salesforce users. If you use the Flow Builder for your experiment, you can optionally set the subject to either Salesforce users or Salesforce records (Lead, Contact, or Case). You will make this selection in the custom Flow Builder Lightning Web Component.

Subject = Salesforce user

This option locks the pairing of a given variation experience with a given Salesforce user. A variation will be assigned to each user bucketed into an experiment. The user will only see that variation while the experiment is active. 

For example, if a Lightning Page Builder Experiment is running for the case page and User X loads that page, that user will be assigned one of the case page variations experiences (e.g. Variation 1). User X will always see Variation 1 as long as the experiment is active, regardless of any activity they may take.

Subject = Salesforce record

This option presents a user with different variation experiences, but locks the variation experience associated with a given record.

When the subject of an experiment is Salesforce records, OpX assigns a variation experience to the record (Lead, Contact, or Case), and users will have different variation experiences when they click on different records. So long as the experiment is active, the variation experience/record pairing will remain constant, but the variation experience that users see can change. 

For example, if a flow experiment is running on the case page and User X loads a given case record, the user will see one of the flow variations for that record. However, User X may see a different variation if they navigate to a different case record.

Visitor ID

Regardless of what the subject is set to, each Salesforce user included in an experiment is assigned a Salesforce Visitor ID. If you are using Optimizely's experiment templates, or our invocable method, the Visitor ID is automatically generated, and set as a users's Salesforce ID appended to the associated Salesforce Organization ID. If you are not using these approaches to experimentation, you will need to call the global method to generate the Visitor ID.

Visitor IDs are unique within an Account and have no particular length or string pattern requirements.

Experiment audiences

With the OpX app, you control which users may be included in your experiments by using Salesforce’s assignment controls. 

You will select your experiment audience when activating the custom Lightning Record Page changes (which include your variation experiences). You can assign them as updates to specific apps, form factors (e.g. Desktop), record types (e.g. Master), and profiles (e.g. Standard User).

When you have completed all other steps for your experiment and are ready to deploy it, complete the following activation steps:

  1. From the custom page you’ve configured in the Lightning App Builder, click Activation.

  2. Assign the pages as desired. To do so: 

    • Click Assign as X. If you assign as Org Default:

      1. Select Form Factor

      2. Review your assignment

      3. Click Save

    • If you assign as App Default

      1. Select desired apps

      2. Select Form Factor 

      3. Review your assignment

      4. Click Save

    • If you assign as App, Record Type, and Profile:

      1. Select desired apps

      2. Select Form Factor 

      3. Select Record Types

      4. Select Profiles

      5. Review your assignment

      6. Click Save.

After clicking Save there is no success notification, but your experiment is now fully running.

Activation when assigning custom page as org default