Highlighting & Masking
Emphasize the consent action in your visual record and redact sensitive fields before they leave the browser.
Highlighting
Highlighting draws attention to the exact submit button/action the user clicked in the visual record. This is especially useful when your form has multiple submit buttons (for example, multiple-choice options) and you need to show which specific button was used. Your live page is not affected.
1. Add a label to the element
<!-- Mark the consent action element -->
<button type="submit" data-expressconsent-highlight-label="consent-submit">
I agree & submit
</button>Multiple buttons
Give each button a unique label, then pass the one the user actually clicked as highlightTarget.
<!-- Multiple choice: each button gets a unique label -->
<button type="submit" data-expressconsent-highlight-label="opt-in-calls">
Yes, call me
</button>
<button type="submit" data-expressconsent-highlight-label="opt-in-texts">
Yes, text me
</button>2. Pass the token to captureCDR
// Pass the label that matches the button the user clicked.
await window.ExpressConsent.captureCDR({
highlightTarget: "consent-submit",
});The highlightTarget value must exactly match the data-expressconsent-highlight-label attribute. The SDK matches the first element it finds with that label.
Masking
Masking redacts sensitive data (SSN, CVV, passwords) from the evidence before it leaves the browser. Masked data is gone permanently — you cannot recover it, even as the org owner.
The more you mask, the less useful the visual snapshot is as evidence. Only mask what is strictly necessary (e.g. payment details, government IDs). Never mask consent language, checkboxes, or submit buttons.
Mask a single input
<label>
SSN
<input name="ssn" data-expressconsent-mask />
</label>Mask an entire section
The attribute is inherited by descendants. Place it on a container to redact everything inside.
<section data-expressconsent-mask>
<h3>Payment details</h3>
<input name="cardNumber" />
<input name="cvv" />
<!-- Everything inside is masked -->
</section>Common pitfalls
- Highlight doesn’t appear: token mismatch between the attribute and
highlightTarget - Masking too much: placing
data-expressconsent-maskon a broad container accidentally redacts consent UI, weakening the evidence - Element not in page yet: the label is added asynchronously after
captureCDR()runs