# Configure external system to work with the Sitefinity tracking cookie

## Overview

Tracking consent user choice is saved in a cookie named `sf-tracking-consent` on the client’s browser. The cookie is set to `true` when the user consents to tracking their behavior, and to `false` when the user declines. This cookie is used by both Sitefinity CMS and Sitefinity Insight.

When integrating a third-party content tracking solution, you must ensure that the third-party solution handles this cookie and sets it to reflect the user consent correctly. That is, your third-party solution must turn off itself when the cookie is set to `false`.

In this article, you learn how to configure the external system to be in sync with the state of the `sf-tracking-consent` cookie.

## Code sample

This code sample demonstrates to use the built-in Sitefinity consent tracking together with a third-party system.
You wrap the call to the external JavaScript code with custom code in the following way:

```JavaScript
<script type="text/javascript">
(function() {
        function loadAndTrack(canTrack) {
            if (!canTrack) {
                return;
            }
            
            // Call the external script here
          third_party_code();
        }
    
        (function() {
            if (window.TrackingConsentManager) {
                TrackingConsentManager.addEventListener('ConsentChanged', loadAndTrack);
                loadAndTrack(TrackingConsentManager.canTrackCurrentUser());
            }
            else {
                loadAndTrack(true);
            }
        })();
})();
</script>

```
