For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Contact UsSign In
HomeIntegrationsGuidesBrand Assets
HomeIntegrationsGuidesBrand Assets
    • Overview
  • IAM Platforms
  • OIDC
    • Overview
    • Configuration
    • Integration
    • Best Practices
    • PKCE
  • SAML
    • Overview
    • Configuration
    • Integration
    • Best Practices
  • OAuth 2.0
    • Overview
    • Integration
    • PKCE
      • Community Group Payloads
      • Android SDK
      • iOS SDK
      • Conversion Tracking
    • Error Codes
  • Shared Signals Framework
    • Registration and Transmission
  • Mobile SDK
    • Overview
    • Android
    • iOS
    • Video Demos
  • API
    • Applications API
    • Document Passback API
  • Learn More
    • Language Support
LogoLogo
Contact UsSign In
On this page
  • Event shape
OAuth 2.0Communities

Conversion Tracking

Was this page helpful?
Edit this page
Previous

Error codes

Next
Built with

Conversion tracking lets you attribute completed orders back to ID.me verification events. When enabled, the button widget mints a unique identifier when the button is rendered (or clicked, for popup flows), passes it through the verification flow as conversion_tracking_id, and stores it in a first-party cookie so you can include it with conversion events on your order confirmation page.

1

Enable tracking on the button

Add data-conversion-tracking="true" to your button widget:

Example
1<span
2 id="idme-wallet-button"
3 data-scope="military,responder,student,teacher"
4 data-client-id="[YOUR_CLIENT_ID]"
5 data-redirect="[YOUR_REDIRECT_URI]"
6 data-response="code"
7 data-display="popup"
8 data-conversion-tracking="true">
9</span>
10<script src="https://s3.amazonaws.com/idme/developer/idme-buttons/assets-v2/js/idme-wallet-button.js"></script>

Consent gating. If you need to defer tracking until the user has accepted cookies, set data-conversion-tracking to the name of a global function that returns a boolean. The widget calls it at bind time and fails closed (no tracking) if the function is missing, throws, or returns anything other than true.

Consent-gated example
1<span
2 id="idme-wallet-button"
3 ...
4 data-conversion-tracking="hasMarketingConsent">
5</span>
6<script>
7 window.hasMarketingConsent = function () {
8 return window.MyCmp && window.MyCmp.consent("marketing") === true;
9 };
10</script>
2

Send conversion events

On your order confirmation or thank-you page, include the conversion tracking SDK and call idmeConversion.track():

Example
1<script
2 src="https://s3.amazonaws.com/idme/developer/idme-buttons/assets-v2/js/idme-conversion-tracking.js"
3 data-app-id="[YOUR_APP_ID]">
4</script>
5<script>
6 idmeConversion.track("Order Completed", {
7 orderId: "ORD-123",
8 total: 149.99,
9 revenue: 139.99,
10 currency: "USD",
11 products: [
12 { sku: "SKU-001", name: "Widget", price: 49.99, quantity: 3 }
13 ]
14 });
15</script>

The SDK reads the idme_ctid cookie that was set when the user clicked the button, attaches it to the event as conversionTrackingId, and posts the envelope to ID.me. If no cookie is present (e.g., the user did not arrive via a tracked ID.me button), the call is a safe no-op.

Best practice

Only include idme-conversion-tracking.js on confirmation/thank-you pages. The button widget handles cookie creation on pages where the button itself is rendered.

Event shape

The SDK wraps your call in an envelope that matches the Order Completed v1 schema. You only supply the event name and properties; the SDK fills in eventId, timestamp, context, and the conversion ID.

FieldRequiredNotes
eventYesMust be "Order Completed".
properties.orderIdYesStable across retries so downstream systems can dedupe.
properties.totalNoOrder total including shipping and tax (after discount).
properties.revenueNoOrder revenue excluding shipping and tax. Typically the conversion value used by analytics.
properties.shipping, tax, discountNoNumbers.
properties.currencyNoISO 4217 three-letter code (e.g., USD, EUR). Uppercase.
properties.coupon, affiliationNoStrings.
properties.productsNoArray of line items. Common fields: productId, sku, name, brand, category, variant, price, quantity.

Additional properties are accepted and forwarded.