Manage session traits
This topic provides information on how to search, edit, pause, deactivate, duplicate, and delete a session trait, copy its ID, and copy its code to a new session trait.
Only team members with a Developer or Admin role in Sitecore Cloud Portal can manage session traits.
Search for a session trait
You can easily search for a session trait by selecting its type, searching by name or identifier, or using filters.
To search for a session trait:
-
In the navigation pane, click Developer center > Session traits.
-
On the Session Traits page, search for a session trait by its name, identifier, or content.
-
Optionally, apply these filters to locate a session trait:
-
Tags - filter by one or more tags.
-
Status - filter on whether the session trait is activated, paused, or has a status of Draft.
-
Last Updated By - filter by the user who last updated the session trait. To sort the session traits list according to first or last updated, click
on the column heading.
-
Copy code from a session trait
You can copy the JavaScript code of a session trait from the code editor and paste it into a new session trait.
To copy code from a session trait:
-
From the Session Traits page, open the session trait from which you want to copy code.
-
Click Copy
and paste the JavaScript code into the code editor of a new session trait.
Copy the friendly ID of a session trait
When you create a session trait, Sitecore CDP automatically creates a unique ID for it. You can easily copy this friendlyId from the Details pane.
To copy the friendly ID:
-
From the Session Traits page, open the session trait you want to view.
-
In the Details pane, click
to copy the Friendly ID of the session trait.NoteYou can use this ID to reference the session trait and access its value within Sitecore CDP.
Edit a session trait
You can continue editing a session trait while it is in Draft or Paused status.
To edit a session trait:
-
From the Session Traits page, open the session trait you want to edit.
-
Click Edit
. -
Make the necessary changes to the code and click Save.
Pause a session trait
You can pause an Active session trait to temporarily stop it from running at the end of each customer's session and storing any new data. Previous values calculated for the paused session trait will remain intact in the respective guest profiles.
To pause a session trait:
-
From the Session Traits page, open the session trait you want to pause.
-
Click Pause.
-
In the confirmation dialog, click Pause.
Deactivate a session trait
You can deactivate a Paused session trait to delete all data associated with it for customer sessions that end after the session trait has been deactivated.
To deactivate a session trait:
-
From the Session Traits page, open the session trait you want to deactivate.
-
Click
> Deactivate. -
In the confirmation dialog, click Deactivate.
Duplicate a session trait
You can duplicate a session trait in any status to copy its code, description, and tags into a new session trait.
To duplicate a session trait:
-
From the Session Traits page, open the session trait you want to duplicate.
-
Click Duplicate.
-
Rename the duplicated session trait and click Create.
Delete a session trait
You can only delete a session trait if it is in Draft or Inactive status. Before proceeding, check all references to the session trait within Sitecore CDP to prevent data corruption.
When you delete a session trait, it is removed from the Session Traits page. The session trait is also removed from the customer's guest profile after their next session ends. This action deletes the session trait object along with its friendlyId, name, value, and other attributes.
This action is permanent, and the session trait cannot be recovered.
To delete a session trait:
-
From the Session Traits page, open the session trait you want to delete.
-
Click
> Delete. -
In the confirmation dialog, click Delete.