Compliance & consent
The Uniform tracker handles visitor classification, but the tracker requires the developer indicate that the visitor has provided their consent to be tracked. This section describes how to use this functionality.
tip
For more information about the components involved with visitor tracking, see the documentation for the @uniformdev/context package.
Use a cookie to track visitor consent
The following example creates a button that you can add to an application that the visitor can click in order to provide their consent.
- React (TS)
Pattern loading...
Disable check for consent
The Uniform Context object handles tracking. When this object is initialized, you can specify whether consent has been granted. During development and testing, when an external visitor is not involved, it can be convenient to disable the requirement that the visitor provide their consent.
- React (JS)
const context = new Context({
manifest: { project: {} },
defaultConsent: true,
});