Customer journey error reporting
Introduction
In this scenario the marketing and website team are keen to ensure the removal of any friction from their customers journey. To know what to address the team want to see what errors occur during typical visits. Key KPIs required are:
- How many errors over a time period (hour, day, week)
- What error values occur most often
- Are errors occurring on regularly and on specific pages or screenviews
- Are errors coinciding with an abandoned purchases
- ...
As we go through this scenario we will use Events (both standard and advanced), HA’s, Dimensions, SA’s, Reports. All of these basic functions are covered in the detail in the Guide Me sections.
ARCADE of WHAT the RESULT is
We start in reverse, HA’s first, then Dimensions, SA’s, etc.. These components are needed to build reports.
Hit Attributes
Locate the various errors from the visitors journey from a typical session replay previously captured.
Naming
HA’s identify data in a visitors journey, and can optionally be refined using RegEx. Name and describe these accordingly, avoid the use of the word capture as they don’t capture anything.
- Using an example session that includes errors, find the screenview / page with the error in the navigation pane, right-click, select Response
- Error(s) are displayed text, displayed text is located in the HTML (as a full DOM) or domDiff
- Create the HA(s)
ARCADE
Different HTML tags?
A site may display errors using different styling or HTML tags. You may need to use multiple HA’s.
Session Attributes
It’s not always necessary to use SA’s next, it depends on the scenario and Dimensions may only be needed.
- Create a SA.
ARCADE*
Why a Session Attribute
SA’s have useful properties:
- Can store multiple errors as they occur from any page, just feed it the HA
- Are available to Events at anytime to query
- Can be linked with Dimensions and Events (Both standard and advanced)
Report Groups and Dimensions
- Create a Report Group
ARCADE
Limitations and Naming
Describe these accordingly, their purpose is to group dimensions used to provide different views of your report data. Report Groups can only contain four (4) Dimensions only, once set cannot be removed.
1.
Events
ARCADE
Naming
Events may work stand alone and can be linked with other Events. Events may be advanced too, or for reporting purposes only. Consider their function and naming. You can rename an event, however it does not rename the internal name reference which may be used in advanced events.
- Prefix names with [BB] if specifically liked with others Events
- Prefix [ADV] or [BB ADV] where the Event is advanced and or a linked event
- Prefix [RPT], if used solely for reporting purposes
Dashboards
ARCADE
Use case or function
There are no limitations to naming or.the number of tabs in a dashboard. Consider their naming based on the use case or the reports contained.
Reports
Use case or function
There are no limitations to naming or.the number of tabs in a dashboard. Consider their naming based on the use case or the reports contained.
Multiple error message ...
if ($F.factCount("CUST.F_E_DOMAIN_639083889830424227") > 0)
{
if (messageCount > 1) {
$F.setFact("CUST.F_E_TEST_639088161343646642", "Multiple Validation Errors");
$F.setFact("CUST.F_E_TEST2_639088181603768394_FACT2", messageCount);
Individual error messages ...
The following example is a different approach to using the DOMObserver UIC module, this module is also often used to support Replay fidelity.
DOMObserver: {
targets: [
{
selector: "body", // Parent selector attaches observer for class=errorModal
childNode: "em-error-li", // Look for child node to trigger snapshot (blank for ANY) em-error-li
eventName: "DCXerror", // Name of event to log in DCX (must configure in UIC)
added: 1, // Look for child node 0=removed, 1=added or 2=added-or-removed from DOM
maxEvents: 50, // After triggering X number of times, stop monitoring this event (0=Unlimited)
customFunction: function(mutatedTarget, eventName) {
// Select each error list item
var errors = mutatedTarget.querySelectorAll("li.em-error-li");
errors.forEach(function (li) {
var strong = li.querySelector("strong");
if (!strong) return;
var field = strong.textContent.trim(); // Error field name
var fullText = li.textContent.trim(); // Full text of the LI (includes description)
// Remove the field label from the full text to isolate the description
var description = fullText.replace(field, "").replace(/^:\s*/, "").trim();
var errorText = field.replace(/:$/, "") + ": " + description;
console.log("error: " + errorText);
DCX.logCustomEvent("error", errorText);
});
}
}
]
},