In Sitecore 9, Sitecore have decided to change how you identify named users, i.e. how you match a Contact with a user that is logged into your website. The Tracker.Current.Session.Identify method is obsolete. It has been replaced with Tracker.Current.Session.IdentifyAs:
// Sitecore 8 identification method: public static void IdentifyUser(string username) { // Never identify an anonymous user if (username.ToLower() == "extranet\\anonymous") return; if (Tracker.Current != null && Tracker.Current.IsActive && Tracker.Current.Session != null) { Tracker.Current.Session.Identify(username); } } // Sitecore 9 identification method: public static void IdentifyUser(string username) { // Never identify an anonymous user if (username.ToLower() == "extranet\\anonymous") return; string identificationSource = "website"; if (Tracker.Current != null && Tracker.Current.IsActive && Tracker.Current.Session != null) { Tracker.Current.Session.IdentifyAs(identificationSource, username); } }
The IdentifyAs() takes 2 parameters:
- Source: A string that identifies where this contact comes from (for instance, “twitter” or “website”)
- Identifier: The identifier itself (username, email, customerID or any other string based on your implementation)
Thanks to Sitecore support for the claification.
MORE TO READ:
- Contact identifiers from doc.sitecore.net
- Sitecore 8 and Tracker.Current.Session.Identify – Overriding expired contact session lock for contact id by briancaos
Pingback: Sitecore 8 and Tracker.Current.Session.Identify – Overriding expired contact session lock for contact id | Brian Pedersen's Sitecore and .NET Blog
Pingback: Part 1 – Experience Profile – Identify Users Early – Aceik