WE have enabled Cookie Policy popup in our Site.. If end user not accept the cookie policy then we have to store its IP address as or blank in XDB... Once it accept then the actual IP address would store .

Do we have any solution based on the user visit.

We have setting in Sitecore Marketing and XDB configuration for REDACT the IP but its storing for all the user but the requirement is based on user visits , if user not accept cookie policy then store else its actual IP.

  • The Cookie Policy is not about whether you store an IP address or not (that relates to GDPR). You should disable marketing cookies until that banner is accepted - NOT just continue serving cookies and storing a fake IP. Sep 23, 2019 at 10:21

1 Answer 1


I think what you want can be achieved by a couple of different steps. Setting a custom cookie value to indicate whether user accepted cookie policy or not is the first step.

The next step is to set the ip address which is stored in the IpInfo facet on the contact. You can override this with the ip based on the cookie value.

I wonder though, whether you wouldn't be better off by disabling tracking for the user in his session until he accepted your cookie policy. I think this is a more common approach.

  • I have created custom Pipeline by inheriting the "StartAnalytics" class and wrote the line "Sitecore.Analytics.Tracker.Enabled = false;" but its not etting the IP ..The below code is working on same pipeline :- IPAddress address = IPAddress.Parse(""); Tracker.Current.Interaction.Ip = address.GetAddressBytes();
    – Shailesh
    Sep 23, 2019 at 9:07
  • so you are saying you disable tracking, but still you get an entry with ip address? I would expect any data in xDB at this point. You could try setting the ip like: Tracker.Current.Interaction.Ip = Sitecore.Analytics.Lookups.IpHashProviderBase.EmptyIpAddress; This is how the Redact function does it.
    – Joost
    Sep 23, 2019 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.