If you are using the Analytics module, regardless of whether you have configured the Sitefinity CMS Analytics module or you use directly Google Analytics, you must modify the Google Tracking code, in order to incorporate the Tracking consent functionality.
IMPORTANT: If you do not setup the Analytics module to work with Tracking consent functionality, when the tracking consent is turned on for a domain, the Analytics module will continue gather statistics, regardless of the choice that the user has made.
Perform the following:
IMPORTANT: If you have not yet setup the Analytics module, it is important to use the tracking code generated by Sitefinity CMS and not the one from your Google Analytics account.
EXAMPLE: The following JavaScript is an example of the JavaScript that Sitefinity CMS generates when you configure the Analytics module. The script is generated regardless of whether Tracking consent is turned on or off:
The script above check, if the window.TrackingConsentManager object exists. The object is created by Sitefinity CMS when Tracking consent feature is enabled. If the object exists, the script subscribes for ConsentChanged event and invokes loadAndTrack function. If the object does not exist, the script loads the Analytics tracking code.
window.TrackingConsentManager
ConsentChanged
loadAndTrack
The loadAndTrack function does the following:
canTrack
false
true
You can use the same approach to start or stop any client side tracker.
IMPORTANT: In case, you are using Google Analytics, but have not setup the Sitefinity CMS Analytics module, you must still use this tracking code. You can use the one, provided in the above example. You only need to change the tacking ID, which in this case is UA-00000000-0.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important