This code is only droping the cookies from the cookie board, the analytics is still on for the user. Is there any way to disable/enable xdb.enabled
to false/true based on country region.
if (countryCode != "IN" && countryCode != "US")
{
if (HasCookieConsent())
{
if (HttpContext.Current.Request.Cookies["SC_ANALYTICS_GLOBAL_COOKIE"] != null)
{
var myCookie = new HttpCookie("SC_ANALYTICS_GLOBAL_COOKIE");
myCookie.Expires = DateTime.Now.AddDays(-1d);
HttpContext.Current.Response.Cookies.Add(myCookie);
}
args.AbortPipeline();
}
}
Sitecore.Analytics.Tracker.Current?.EndTracking();
before aborting the pipeline as given in this article? blog.baslijten.com/…