Tracking consent Client-side API
When you enable Tracking consent functionality, for every client page, Sitefinity CMS creates a global JavaScript object named TrackingConsentManager. The object is responsible for displaying a tracking consent dialog and storing user choice.
The TrackingConsentManager object has following methods:
Init
Initializes the object by specifying template for consent dialog.canTrackCurrentUser
Returnstrue, if current user has provided consent, otherwise, returnsfalse.updateUserConsent
Updates the user consent. If this method is invoked with true, Sitefinity CMS considers that the user has provided consent for being tracked.askForUserConsent
Initialized and displays the user consent dialog.addEventListener
Register event handler for a specific event.removeEventListener
Cleans up event handler for a specific event.
TrackingConsentManager triggers the following events:
AfterDialogDisplayed
Triggered right after consent dialog is added to the DOM.BeforeDialogClosed
Triggered before consent dialog template is removed from the DOM.ConsentChanged
Triggered when user consent is changed.
EXAMPLE: For examples of how to use these methods and events, see Modify the appearance of the consent dialog.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
Foundations of Sitefinity ASP.NET Core Development
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.