Persist consent on your backend (optional)

By default, Transcend Consent Management stores your user’s consent information in entirely in the user’s browser. This is sufficient to respect user’s consent choices as they navigate your site.

However, if you would like to store and restore the user’s consent information in your own backend, e.g., to ensure that logged-in users’ consent information is persisted across sessions and browsers, you will need to create a custom endpoint to store and return that information.

For a full view of the architecture tenants of client/server synchronization, see Full Stack Consent.

To persist user tracking consent & the Do-Not-Sell preference to your backend, use this snippet which privately synchronizes tracking consent from all of your first-party domains, and then sends the latest consent data to /your-backend-sync-endpoint as an HTTP POST request.

// wait for cross-domain sync
await airgap.sync();
// POST consent data to your backend
navigator.sendBeacon(
  '/your-backend-sync-endpoint',
  JSON.stringify({
    consent: airgap.getConsent(),
    // user: getUser(),
    // auth: getBackendSignedAuthTokenForUser(),
  })
);

To restore server-stored consent to a known logged-in user, dynamically include an onload handler on your consent manager script uniquely for the user once, as such:

<script
  onload="airgap.setConsent(event, {Functional:true, Advertising:true, Analytics:true, SaleOfInfo: true})"
  src="https://transcend-cdn.com/cm/{your-bundle-id}/airgap.js"
></script>

Default consent emitted from Transcend's backend can be managed in the advanced settings section of the Admin Dashboard.