Custom event feed
Custom event feeds provide developers with the means to do the following:
-
Add custom code to the content management system.
-
Filter on a custom event ID.
-
Create a custom event feed.
The custom event ID provides the reference when the event is triggered.
Custom events can track specific user interactions, including:
-
Button clicks.
-
Section expansions.
-
Link clicks.
-
Document downloads.
Setting up a custom event feed involves three distinct procedures.
Create a custom event feed
To setup a custom website behavior event feed:
-
Log in to your Squiz DXP instance.
-
Click the Customer data platform button.
-
From the left-hand navigation select Event feeds.
-
Click the Create Event feed menu button.
If no other Event feeds exist, the button presents near the centre of the Event feeds page.
If other Event feeds are extant, the button presents in the top-right corner of the Event feeds page.
-
Select
The Create website behavior event feed page loads.
Configure the event details
On the Create website behavior event feed page configure the details for the custom event.

- Name
-
Enter a descriptive, memorable, and unique name for the event.
Generic or general names are not recommended.
- ID
-
The event ID is automatically generated from the Name value.
When the event is saved, this ID value is fixed.
It cannot be changed.
- Source
-
Automatically set to Website behavior.
- Event type
-
choose Custom from the Event type menu.
- Event type
-
choose
. - Custom event ID
-
Enter a descriptive, memorable, and unique name for the event.
This Custom Event ID is required to reference the web event when it is triggered.
- Time period in days (optional)
-
Set a rolling time window for event counting.
This field only accepts positive whole numbers.
Expand
- Definition
-
When you set a time period (for example, seven days), the system counts how many times a specific event (like a page view) occurred per user within that rolling window.
If a user visits your homepage five times in seven days, their count for Page View would be five.
- Dynamic event count
-
New events are added to the count.
Events older than the defined period (for example, an event eight days ago on a seven-day window) are automatically excluded.
This helps to track recent engagement and avoid stale data by focusing on activity within your chosen timeframe.
The default is 60 days.
Set the custom event feed attribute filters
Custom event feed attribute filters allow the event feed to be triggered against any entered attribute name and value.
For all attributes the filtering rule is whether the attribute type is or is not the nominated value (that is Equals or Does not Equal the nominated value).
Setting multiple attribute filters
Multiple filters can be set for a given event feed, and the matching logic across multiple filters can be either AND or OR.
The rule matching logic applies across all attribute filters set for a given feed. That is, the matching logic allows for two different rule matching states.
|
Create the event feed
-
Click the Create event feed button.
A Changes saved alert presents towards the top-right of the screen, and the Event feeds page reloads with the new event listed.
-
Alternatively, click the Cancel button to return to the Event feeds page without saving any of the entered details (and, if applicable, without saving any of the Attribute filters).
Configure the segmentation for the custom event feed
The Squiz CDP uses Segmentation to identify meaningful differences between groups of users.
This procedure sets up a segment that uses a custom event feed to distinguish between two user groups.
To create a new segment:
-
Log in to your Squiz DXP instance.
-
Click the Customer data platform button.
-
From the left-hand navigation select Segmentation.
-
Click the Create a segment menu button.
If no other Segments exist, the button presents near the centre of the Segmentation page.
If other Segments are extant, the button presents in the top-right corner of the Segmentation page.
-
The Create a segment page loads.
Configure the segment details
On the Create a segment page configure the details for the custom event.

- Segment Name
-
Enter a descriptive, memorable, and unique name for the event.
Generic or general names are not recommended.
- Segment ID
-
The event ID is automatically generated from the Segment Name value.
When the segment is saved, this ID value is fixed.
It cannot be changed.
- Description
-
Add a succinct explanation regarding what user category the segment represents.
Add the custom event feed as a rule to the segment
-
Click the ➕ Add a rule set button.
-
Select menu:➕ Add a rule set[Web behavior]
The Website behavior rule set settings UI presents.
Figure 3. Create a single segment with website behavior rule set UI.- Website behavior event feed
-
Click the Website behavior event feed and select the previously created custom feed from the menu items that present.
- Rule
-
Click the Rule and select an option from the menu items that present.
Available rules operators are:
-
Less than.
-
Less than or equal to.
-
Greater than.
-
Greater than or equal to.
-
Equals.
-
Does not equal.
-
- Count
-
Set this to the desired number of occurrences of the selected event feed.
- Time period
-
The time period is passed through from the event feed and can not be changed in the rules.
Create the segment
-
Click the Create button.
A Segment created alert presents towards the top-right of the screen, and the Segmentation page reloads with the new segment listed.
-
Alternatively, click the Cancel button to return to the Segmentation page without saving any of the entered details or rules.
Implement the custom event in the CMS
Implementing the custom event in the CMS to allow the website to trigger custom events based on user interactions requires embedding appropriate JavaScript code into your page templates’ HTML
The code presented below, for example, adds custom button click events on a page.
<!-- Buttons to trigger persona selection -->
<p><button id="customer">I am a customer</button></p>
<p><button id="prospect">I am a prospect</button></p>
<p><button id="domestic">I am domestic</button></p>
<p><button id="international">I am international</button></p>
<!-- Response message -->
<div id="response"></div>
<!-- JavaScript to send event to CDP -->
<script>
function sendCustomEvent(actionId, personaType) {
var responseBox = document.getElementById("response");
responseBox.innerHTML = "Sending event...";
var headers = new Headers();
headers.append("Content-Type", "application/json");
var payload = JSON.stringify({
source: "custom",
action: actionId,
event: {
type: personaType
}
});
var requestOptions = {
method: 'POST',
headers: headers,
body: payload,
redirect: 'follow'
};
fetch("/__dxp/events/custom", requestOptions)
.then(response => {
if (response.status === 202) {
responseBox.innerHTML = "Event successfully tracked – persona should be updated within 30 seconds.";
} else {
responseBox.innerHTML = "Event failed – please check your setup or confirm that consent has been granted.";
}
})
.catch(error => {
console.error("Tracking error:", error);
responseBox.innerHTML = "Error sending event – see console for details.";
});
}
// Event listeners for each button
document.getElementById('customer').addEventListener('click', () => sendCustomEvent('persona-selector', 'customer'));
document.getElementById('prospect').addEventListener('click', () => sendCustomEvent('persona-selector', 'prospect'));
document.getElementById('domestic').addEventListener('click', () => sendCustomEvent('persona-selector', 'domestic'));
document.getElementById('international').addEventListener('click', () => sendCustomEvent('persona-selector', 'international'));
</script>