Create a trigger for a triggered experiment
You can select a standard event or custom event to run the experiment. When the event is raised, if the event type and logic conditions both return true, Sitecore Personalize triggers the experiment.
If you want to also run custom logic against any attributes within the event type, you can define the logic using JavaScript. You can reference the event type when you create a custom condition using entity parameters.
You can create a custom event to apply triggers to any type of online guest behavior.
To create a trigger:
-
On the experiment builder, click the Trigger tile.
Additional fields display.
-
Click Add trigger.
-
To use a standard event as the trigger to run the experiment, select one of the following from the Trigger drop-down list:
-
Guest Created - Triggers the experiment after the creation of a guest.
See identifying guests in Sitecore Personalize for more information on how guests are created and identified.
-
Order Created - Triggers the experiment after the order is created. For example, if the guest creates an order, you can trigger an email that contains the details of the order.
See sending orders for all the available options on creating orders using the Sitecore Personalize Stream API.
-
Order Updated - Triggers the experiment after the guest's order has been updated. For example, if an ancillary (order item) is added to the order, you can trigger an email confirming the updated order.
Your organization must have a Sitecore CDP license to use this trigger. You can update an order using the Sitecore CDP REST API or update an order using the Sitecore CDP Batch API.
-
Session Closed - Triggers the experiment when the guest's session closes and Sitecore Personalize receives a
SESSION_CLOSE
event type. The closed session can be due to the guest abandoning their session, network latency, or the guest being inactive. The amount of time that a guest's session will close due to inactivity is configured for your organisation's website, by your organization. -
Guest Modified Custom - Triggers the experiment after the guest is modified by a guest attribute that is custom for your organization. For example, if the value of a guest's data extension is modified. A data extension is a custom attribute that you can pass to Sitecore Personalize, which is not part of the data model. For example, you might want to trigger an experiment that sends an email to the guest if they have enough points to qualify for the next loyalty member tier.
Your organization must have a Sitecore CDP license to use this trigger. You can update a guest data extension using the Sitecore CDP REST API or update a guest data extension using the Sitecore CDP Batch API.
-
Abandoned Cart - Triggers the experiment if the guest has items in their virtual shopping cart and the session closes. The session close could be due to the guest abandoning their session, network latency, or the guest being inactive for the session to timeout and close. The amount of time that a guest's session will close due to inactivity is configured for your organization's website, by your organization.
See cart abandonment for more information.
-
-
To create a custom trigger, select the Custom option and complete the following:
-
Event Name - Enter the standard or custom event type. For example,
ADD_TO_CART
. The event will be available as an attribute in the guest context service, which is an internal service.See sending events for information on sending events using the Sitecore Personalize Stream API.
-
Description - Enter a description of the event.
-
Event Identifier - Select an operator and enter a value for the event identifier:
-
Equals - Triggers the experiment if the specified event is an exact match. Enter the name of the event in the text field.
-
Regex - Triggers the experiment if the event and conditions match the specified Regular Expression (RegEx) pattern. This is useful if you need to use more than one contains conditions because you can match different events with just one regular expression. Enter the RegEx characters in the field. For more details on how to write RegEx characters, see https://www.regular-expressions.info.
-
Starts with - Triggers the experiment if the event starts with the specified string. Enter the string in the text field.
-
-
To add additional event identifiers, click Add identifier. Sitecore Personalize will trigger the experiment, if any of the event identifiers return true.
-
-
Click Save to close the pane.