Disclosure Tracking

Tag disclosure text in your HTML with data-ec-disclosure, then pass agreement status in captureCDR(). The SDK extracts the tagged text from the DOM and stores it alongside the CDR for programmatic verification.

How it works

  1. Tag disclosure text in HTML with data-ec-disclosure="key". The value is a key that identifies the disclosure.
  2. Pass agreement status in captureCDR() via the disclosures parameter: { "key": boolean }.
  3. The SDK extracts the tagged text from the DOM and pairs it with the boolean to produce a disclosures array in the CDR metadata.

Single disclosure

Tag the disclosure element and pass the agreement status:

html
<!-- Tag the disclosure text -->
<p data-ec-disclosure="sms">
  By submitting this form, you consent to receive automated
  SMS messages from Acme Corp. Message and data rates may apply.
  You may revoke consent at any time by texting STOP.
</p>
javascript
ExpressConsent.captureCDR({
  disclosures: {
    "sms": true  // user agreed
  }
})

Multiple disclosures

Use different key values to distinguish disclosures on the same page. Each key maps to a data-ec-disclosure attribute value:

html
<!-- Multiple disclosures on one page -->
<p data-ec-disclosure="sms">
  By submitting, you consent to receive SMS messages from Acme Corp...
</p>

<p data-ec-disclosure="email">
  By checking this box, you agree to receive marketing emails...
</p>
javascript
ExpressConsent.captureCDR({
  disclosures: {
    "sms": true,                       // agreed via form submission
    "email": emailCheckbox.checked,    // agreed via checkbox
  }
})

Validation and safety

  • Non-boolean values in disclosures are skipped with a console warning. captureCDR() is never interrupted by invalid disclosure data.
  • Keys with no matching data-ec-disclosure element in the DOM are skipped.
  • Tagged elements not mentioned in disclosures are not captured.
  • Disclosure text is preserved up to 5,000 characters.

What gets stored

Each disclosure entry contains:

  • key — the identifier from the data-ec-disclosure attribute value.
  • language — the extracted text from the DOM element.
  • agreed — the boolean you passed in disclosures.

Where it appears

The disclosures array appears in:

Example in API response

json
{
  "disclosures": [
    {
      "key": "sms",
      "language": "By submitting this form, you consent to receive automated SMS messages from Acme Corp...",
      "agreed": true
    },
    {
      "key": "email",
      "language": "By checking this box, you agree to receive marketing emails...",
      "agreed": false
    }
  ]
}

For lead buyers

Companies receiving CDRs via the share/claim flow can use the disclosures field to programmatically check what disclosure text was reported and whether the generating integration indicated agreement. For independent verification, examine the CDR’s visual snapshot — it shows exactly what the user saw at the moment of capture.

Legacy: Consent Language Detection (deprecated)

Older SDK versions used data-ec-consent-checkbox and data-ec-consent-text attributes with automatic TCPA keyword detection. This approach is deprecated. Existing integrations using these attributes continue to work, but new integrations should use data-ec-disclosure and the disclosures parameter.

html
<!-- DEPRECATED: old checkbox-based attributes -->
<input type="checkbox" data-ec-consent-checkbox="company-a" />
<p data-ec-consent-text="company-a">Disclosure text...</p>

Legacy CDRs store data in the consentLanguage field (with language, source, and optional label). New CDRs using disclosure tracking store data in the disclosures field.

Related docs