Sitecore Personalize Serialization
March 4, 2022 ยท View on GitHub
Whenever something is modified in Sitecore Personalize, it should be serialized (or backuped) in this repository as well. This helps to understand the history of the Sitecore Personalize assets, provides a backup in case something goes wrong, and should help to replicate the Sitecore Personalize organisation assets in other organisations.
Structure
Sitecore Personalize assets are saved in the \demo\experience\personalize folder. They are organized the same way as the Sitecore Personalize main menu. Folder names are exactly the same name as the assets in Sitecore Personalize.
Debug Mode
We save many assets complete JSON representation. To do that, debug mode must be enabled.
- Hover the bottom-left organisation switcher menu.
- Navigate to your name, then "Feature Flags".
- Enable the "debug" flag.
Downloading an Asset Complete JSON Representation
With debug mode enabled:
- In the top-right corner of the screen, click the yellow debug cog icon.
- In the popup top-right corner, click the "Show as JSON" link.
- In the JSON editor, click the black cog icon.
- Select "Download".
Downloading Code Assets
Whenever there is a code editor or JSON view of assets:
- Click the black cog icon.
- Select "Download".
- Do not rename files unless specified.
This will download a file with a specific name or with the generic bx-ace-editor name.
Redacting Secrets
Sitecore Personalize complete JSON representations and decision model XML exports can contain authors email addresses and connection secrets like API keys, usernames and passwords. It is very important to review the downloaded files and redact those secrets.
Connection Secrets
These secrets are present in:
- Connections complete JSON representations.
- Decision models XML export that contain data system nodes.
- Full stack experiences and experiments complete JSON representations that are using a destination connection.
To identify the secrets:
- Carefully review the content of the files to be committed.
To remove the secrets:
- Change the secret by the word
Redacted. - Save the file.
Author Email Addresses
These secrets are present in:
- Offers complete JSON representations.
- Offer templates complete JSON representations.
To identify the secrets:
- Search for the "at" character
@in the files to be committed.
To remove the secrets:
- Change the
createdByandupdatedByvalues by the wordRedacted. - Save the file.
Test Request Names and Email Addresses
Personal information can be left in the request body to test connections when creating them.
These secrets are present in:
- Connections complete JSON representations.
- Full stack experiences and experiments complete JSON representations.
To identify the secrets:
- Search for the "at" character
@in the files to be committed.
To remove the secrets:
- Change the names by
test. - Change the email addresses by
test@test.com. - Save the file.
Experiences and Experiments - Web and Full Stack
- Download the complete JSON representation.
- IMPORTANT: Carefully review the file and redact secrets.
Variants/Content/Webhook Composer
- For each variant:
- For each tab (HTML, CSS, JavaScript, API):
- Download the code using the black cog icon menu.
- See the note below for the HTML tab file name.
- For each tab (HTML, CSS, JavaScript, API):
Variant HTML
The files from the HTML and API tabs have the same name and .txt extension.
- Change the extension of the HTML tab file to
.html.
Advanced Targeting Script
- Download the code using the black cog icon menu.
- Rename the generic file name to
Advanced targeting Script.js.
Custom Real-Time Audience
- Download the code using the black cog icon menu.
- Rename the generic file name to
Custom Real-Time Audience.js.
Decision Models
Only serialize the production variants.
Canvas
At the bottom-left of the canvas are 2 buttons to download an XML and PNG exports.
- Download the XML.
- IMPORTANT: Carefully review the file and redact secrets.
- Download the PNG.
Data Systems
- Take one screenshot of the inputs and outputs of the data system.
- Name the file with the same name as the data system in the canvas.
- IMPORTANT: Edit the image to remove any secret.
Decision Tables
- Take one screenshot of the inputs, outputs, and rules of the decision table.
- Name the file with the same name as the decision table in the canvas.
Programmables
- Download the code using the black cog icon menu.
Offers
- Download the complete JSON representation.
- IMPORTANT: Review the file and redact author email addresses.
Decision Templates
- Download the complete JSON representation.
- Download the code using the black cog icon menu.
Offer Templates
- Download the complete JSON representation.
- IMPORTANT: Review the file and redact author email addresses.
Connections
- Download the complete JSON representation.
- IMPORTANT: Carefully review the file and redact secrets.