<script type="text/javascript">
(function() {
  function loadAndTrack(canTrack) {
    if (!canTrack) {
      deleteCookie('_ga');
      // IMPORTANT: You need to set YOUR_MEASUREMENT_ID to the correct value in the next line
      deleteCookie('_ga_[YOUR_MEASUREMENT_ID]');
      return;
    }
  }
  function deleteCookie(cookieName) {
    // IMPORTANT: You need to set the correct cookieName and domain in the following line
    document.cookie = cookieName + '=;expires=Mon Jan 01 1900 00:00:00 ; path=/ ; domain=.example-cookie-domain.com'; // this deletes the cookie
  }
  (function() {
    if (window.TrackingConsentManager) {
      TrackingConsentManager.addEventListener('ConsentChanged', loadAndTrack);
      loadAndTrack(TrackingConsentManager.canTrackCurrentUser());
    }
    else {
      loadAndTrack(true);
    }
  })();
})();
</script>