0

我使用Sitecore的8.0更新5,當我試圖找出使用Sitecore.Analytics.Exceptions.ContactLockException而合併聯繫人

Tracker.Current.Session.Identify(userKey); 

我得到的錯誤

Sitecore.Analytics接觸。 Exceptions.ContactLockException

下面的添加

整個堆棧跟蹤0
Exception: Sitecore.Analytics.Exceptions.ContactLockException 
Message: Contact 1cd840a6-f367-4b5f-9df1-74240a03fd29 could not be locked in the XDB. 
Source: Sitecore.Analytics 
    at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) 
    at Test.Client.Common.Utilities.AnalyticsHelper.MergeContacts(String userKey) 
+0

您是否找到了解決此問題的解決方案? –

回答

2

這是從大腦的佩德森代碼。

// THIS IS BAD!!! 
// The user could be extranet\anonymous 
if (!Tracker.IsActive) 
    return; 
Tracker.Current.Session.Identify(Sitecore.Context.User.Name); 

// THIS COULD BE A SOLUTION: 
if (!Tracker.IsActive) 
    return; 
if (Sitecore.Current.User.Name.ToLower() == "extranet\\anonymous") 
    return; 
Tracker.Current.Session.Identify(Sitecore.Context.User.Name); 

// OR MAYBE THIS? 
if (!Tracker.IsActive) 
    return; 
if (!Sitecore.Context.User.IsAuthenticated) 
    return; 
Tracker.Current.Session.Identify(Sitecore.Context.User.Name); 

您可以通過鏈接瞭解更多詳情。 https://briancaos.wordpress.com/2015/07/02/sitecore-8-and-tracker-current-session-identify-overriding-expired-contact-session-lock-for-contact-id/

相關問題