Enable error signals in the Connect web library
The error signal captures when users encounter errors on your site, helping marketers identify and segment users who experience issues during critical processes. This enables targeted outreach and recovery campaigns for users who encounter obstacles.
Focus on high-impact errors:
- Payment errors
- Promo code validation failures
- Account registration issues
- Checkout process errors
- Any error that leads users away from the happy path and results in lost sales opportunities
Important
The error signal doesn't replace error monitoring solutions. Its purpose is to enable marketers to segment users who experienced issues and deliver personalized recovery messages.
Availability: Premium and Ultimate
Implementation considerations
Error types
Two error types are supported.
User errors - Caused by user input that doesn't pass validation:
- Form validation failures
- Incorrect payment details
- Invalid promo codes
- Missing required fields
- Format errors (invalid email, phone number, etc.)
Application errors - Generated by the application itself:
- 4xx error pages (404, 403, etc.)
- 5xx server errors
- System failures
- API errors
Detection strategies
User errors:
- Check for error messages after form submission.
- Listen for validation feedback elements appearing in the DOM.
- Monitor error message containers on page load (if page reloads on submission).
Application errors:
- For 4xx/5xx errors, your application must display error placeholder pages that include the Connect library.
- The library cannot capture errors if it doesn't load on the error page.
Surface visibility
Make sure all important user errors are communicated in the interface. If something happens silently without user-facing feedback, it won't be captured by this signal.
Configuration
Method
TLT.logSignal(signalObject)
Sends the signal to the Acoustic Connect endpoint as a JSON object. The Connect library must be initialized before calling this method.
Signal structure
Top-level fields
category: String - Valid value -Behavior.description: String - Description of the signaleffect: String - Describes the effect of the signal on engagement. Valid values:negative,positive. Usenegativefor all error signals.name: String - Name to differentiate this signal from others (for example, "error from website"). Max length - 256 chars.signalType(required): String - Valid value -error.
Signal content
errorIdentifier: String - An identifier assigned to the error (for example, "promoCode", "payment", "registration")errorText(required): String - The content of the error message receivederrorType(required): String - Type of error. Valid values:APPLICATION,USER.signalCustomAttributes: Array of objects - Additional custom attributes. Each object hasnameandvaluestring fields.
Notes:
- If any required field is missing or invalid, the entire signal will be discarded.
- Optional fields enhance the signal but won't prevent processing if omitted or invalid.
Example
// Check that the Connect SDK is present
if (window.TLT && window.TLT.isInitialized()) {
const signal = {
signalType: "error",
name: "error generated by web site",
category: "Behavior",
errorType: "", // Required, must be "application" or "user"
errorText: "", // Required
errorIdentifier: "",
effect: "negative",
signalCustomAttributes: []
},
href = window.location.href;
// Coupon code errors result in message in query string
if (href.includes("/checkout/?CouponCodeErrorMessage=")) {
signal.errorText = href.split("checkout/?CouponCodeErrorMessage=")[1];
if (signal.errorText) {
// Tidy up the message text
signal.errorText = signal.errorText.replaceAll("%20", " ");
// A coupon code error is of type "user" rather than "application"
signal.errorType = "user";
signal.errorIdentifier = "promoCode";
window.TLT.logSignal(signal);
}
}
// In the checkout, payment errors are styled with a particular class. Because the
// page reloads on form submission they appear after load if that submission fails
// so on this site we can check for them on load rather than listening for a click, for example.
if (href.includes("/checkout/")) {
signal.errorText = document.querySelector('form[action="/checkout/Payment/"] > div.notice-error').innerText || "";
if (signal.errorText) {
// Tidy up the message text
signal.errorText = signal.errorText.replaceAll("\n", " ");
// A payment validation error like this is of type "user" rather than "application"
signal.errorType = "user";
signal.errorIdentifier = "payment";
window.TLT.logSignal(signal);
}
}
}
Updated 5 days ago
