Compliance and consent
It's important—and a legal requirement in many jurisdictions—to notify people when you want to collect information about them and to get their consent before doing so. For example, it's common that when you visit a website for the first time you are prompted to accept cookies. This gives you the opportunity to give your consent to being tracked.
By default, Uniform won't collect visitor activity data unless you have received consent from the visitor.
The Uniform tracker handles visitor classification, but the tracker requires the developer to 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.
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 isn't involved, it can be convenient to disable the requirement that the visitor provide their consent.