Test a triggered experience using the Request Bin endpoint
When building experiences in Sitecore Personalize, it is important to test as you build. Sitecore Personalize provides various in-app testing tools for this purpose, which you might already be familiar with if you have built many experiences.
Triggered experiences require a different testing approach compared to web and interactive experiences. To test a triggered experience, you first have to set it to be live and then you trigger it.
This walkthrough guides you through testing a triggered experience using the Request Bin endpoint, which allows you to send requests to a test destination, inspect the data, and debug the experiences effectively.
This walkthrough describes how to:
-
Create a Request Bin to capture and inspect requests.
-
Copy the URL of the Request Bin that will serve as the endpoint where Sitecore Personalize can send data.
Create a connection in Sitecore Personalize
Set up a connection to an external destination from Sitecore Personalize to the Request Bin endpoint. You must have an Enterprise Admin role in Sitecore Cloud Portal to do this.
To create a connection in Sitecore Personalize:
-
On the navigation menu, click Developer Center > Connections.
-
On the Connections page, click Create > Destination.
-
On the Name & Describe page, complete the Name and Description fields, select an icon, and click Next.
-
On the Authenticate page, select None and click Next.
-
On the Request page:
-
In the Request URL section, select POST in the method drop-down list and enter the Request Bin URL.
-
In the Request field, enter a sample JSON request to test your connection. Ensure that the JSON is valid.
-
-
Click Test Request. The Response field will display the results.
-
Click Next to proceed to the Review & Save page, where you verify the connection details.
-
When you are ready to finalize the connection setup, click Save. Note the connection name because it will be required to configure your triggered experience.
Create a triggered experience
After the connection is set up, create a triggered experience and configure the API request to use the connection to the Request Bin.
To create a triggered experience:
-
On the navigation menu, click Experiences. The experience list displays.
-
Click Create > Triggered. The Name Your Experience window displays.
-
In the Name your Experiment field, enter an intuitive name for the experience and click Create.
-
In the Webhook Composer tile, click Configure API request. In the Connection pane, select the connection you created with the Request Bin URL.
-
In the API body editor, compose the API request to include any offers, content, or personalization you want sent to the Request Bin endpoint.
ImportantOnly send non-sensitive data to the Request Bin endpoint. Request Bin is a third-party provider, so avoid sending any sensitive information or personally identifiable information (PII).
-
Click Save.
Add a trigger to the experience
Select a standard or custom event to trigger the experience in Sitecore Personalize. Both the testing and execution of the triggered experience depends on the trigger you select.
To add a trigger to the experience:
-
On the experiment builder, click the Trigger tile.
-
Click Add trigger. You can choose a Standard or Custom trigger from the options.
-
To use a standard system event as the trigger to run the experiment, select the Standard option and, in the drop-down list, select a trigger:
-
Guest Created - runs the experience when a guest is created.
-
Order Created - runs the experience when an order is created.
-
Order Updated - runs the experience when a guest's order is updated.
-
Session Closed - runs the experience when the guest's session ends and Sitecore Personalize receives the SESSION_CLOSE event.
-
Guest Modified Custom - runs the experience when a guest's custom attribute is updated. For example, when a guest's data extension is modified.
-
Abandoned Cart - runs the experience when a guest leaves items in their shopping cart and the session closes.
-
-
To create a custom trigger, select the Custom option and do the following:
-
In the Event Name field, enter the name of the event. For example, ADD_TO_CART.
-
In the Description field, enter the description of the event.
-
In the Event section, in the drop-down list, select an operator:
-
Equals - runs the experience if the specified event is an exact match.
-
Regex - runs the experience if the specified event matches a specified Regular Expression (RegEx) pattern.
-
Starts with - runs the experience if the event starts with the specified string.
-
-
In the Identifier field, enter the name, RegEx pattern, or string of the event.
-
Optionally, to add additional identifiers, click Add identifier. Sitecore Personalize will run the experience if any event identifiers matches
-
-
Click Save.
Test a triggered experience
You can verify that your triggered experiences work as expected by inspecting the requests at the Request Bin test endpoint.
To test a triggered experience:
-
Raise the specific trigger selected for the experience. Here is a quick reference for different triggers and how to raise them using Sitecore Personalize APIs:
Trigger
How to raise the trigger when testing
Guest Created
Order Created
Create a new order and associate it with a guest.
Order Updated
Session Closed
Open a browser to start a session, then manually close it.
Guest Modified Custom
Update an existing guest by creating a data extension.
Abandoned Cart
Open a browser to start a session, add items to the shopping cart, then manually close it.
Custom Trigger
-
After raising the trigger, visit the Request Bin and check the response to verify that your triggered experience is functioning correctly.