Integrate third-party Tracking consent managerSitefinity CMS has out-of-the-box support for managing users’ consent to process their personal information. It consists of UI to show to the website visitors and the infrastructure in the Sitefinity backend to manage the users’ choice. For more information, see Tracking consent.
If you require custom functionality, you can integrate a third-party tracking consent manager.
- Enable Sitefinity CMS infrastructure for tracking consent.
- Hide the built-in dialog from the website visitors.
Configure Sitefinity CMS Tracking consent
To enable Sitefinity CMS to track user consent and configure it to hide the built-in consent dialog, perform the following:
- Use a text editor to create a new HTML file containing this HTML code:
- Save the file in your project’s
~/App_Data/Sitefinity/TrackingConsent/ folder as
- In Sitefinity CMS backed, navigate to Administration » Settings » Tracking Consent.
- To configure consent tracking on all sites in your Sitefinity CMS instance, click Any domain.
To configure a specific domain, click its name in the list.
- Select Ask users for consent to track their activities.
- Click Change.
The Select a template dialog appears.
- Select the
- To save your changes, click Done » Done.
- Refer to the documentation of the third-party consent manager on how to programmatically show its UI to the site visitors and how to get their consent.
- To link the build-in and the 3rd party consent managers, you need to pass a Boolean value to the
updateUserConsent() method. This enables the build-in Consent manager to set up all required cookies, reinitialize Sitefinity Insight tracking client, and enable or disable both server-side and client-side tracking. This sample code illustrates how to use Sitefinity CMS APIs:
RECOMMENDATION: We recommend calling this script in the window’s load event to ensure it is always executed, even if your visitors reach pages through deep links. For more information, see EventTarget.addEventListener().
RECOMMENDATION: We recommend to not working directly with the Sitefinity Insight tracking implementation and cookie. Instead, use the existing Sitefinity CMS infrastructure to enable an easy upgrade to future versions of Sitefinity Insight.
Test the integration
To test that the integration works, perform the following:
- Start your browser’s private browsing mode.
- Browse a few pages and experiment with accepting and rejecting the Tracking consent.
- If the integration is successful and you have accepted the tracking, you can see the following cookies:
sf-tracking-consent with the value
sf-data-intell-subject with a value that is kept when navigating the site and across browsing sessions (outside of Private browsing)
- If you reject tracking, you can see the following cookie:
sf-tracking-consent with value
The third-party consent manager may have the functionality to classify cookies such as Security, Authorization, User preference, Marketing optimization, or Advertising and present the site users’ choice to accept only the cookies from some of these classes. If you want to use such granular control, you should mark the Sitefinity Insight cookie as a Marketing optimization cookie.