setInitialComplianceSettings

The setInitialComplianceSettings() method sets initial compliance settings in the cookie, recording no decision for each consent type. Use this command to confirm that a visitor has viewed the form. You can pass the result from the getNewComplianceTypes() method directly.

Syntax

ppms.cm.api('setInitialComplianceSettings', settings, onFulfilled, onRejected);

Parameters

settings (object, required)

The consent settings object. Example: {consents: ['analytics']} or ['analytics'].

onFulfilled() (function, required)

The fulfillment handler callback (called with result).

onRejected(error)

The rejection handler callback (called with error code). If not specified, the exception will be thrown in the main stack trace.

error (string | object, required)

Error code or exception

Examples

See an example of a custom consent form.