Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Introduction to Sitecore CDP
Data availability
Managing your account
Managing system settings
Managing guests
Batch segmentation
Data browser
Audience export
Dashboards
Developer center
AI in CDP
Glossary
  • Sitecore CDP
  • Developer center
  • Session traits
  • Test a session trait

Test a session trait

We recommend that you test a session trait before activating it in Sitecore CDP to identify any errors and ensure optimal performance. Testing involves previewing the session trait for a single customer. A successful test indicates that the session trait's JavaScript code is correctly configured.

To test a session trait:

  1. Open the session trait and click Test Test icon.

    Test a session trait by running its logic against a selected guest.
  2. In the Test dialog, select a guest to test against by doing one of the following:

    • To select a random guest based on guest type, click in the search box and select Visitor or Customer.

    • To select a specific guest, enter their unique identifier into the search box. You can search for a guest using, for example, an email address, other unique identifier, or browser ID.

    • To select a recently used guest, click the Recent option.

    • To select a bookmarked guest, click the Bookmark option.

    Tip

    You can manually edit the data displayed for the selected guest before initiating the test. This lets you test the session trait logic without the need to find or create a specific guest profile with the relevant attributes.

  3. Click Test to simulate how the session trait would function in production with the selected guest. The latest session that have a type of Web and status Closed will be used for the test. The test also includes validating the JavaScript and output values. Review any validation messages, make the necessary code updates, and retest when needed.

    The test will display the output of the session trait, including its runtime and any logs, on the Response tab.

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore