Skip to content

Instantly share code, notes, and snippets.

@islaytitans
Last active January 17, 2016 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save islaytitans/cc7b9704d104539d9f82 to your computer and use it in GitHub Desktop.
Save islaytitans/cc7b9704d104539d9f82 to your computer and use it in GitHub Desktop.
Setting the identifier of a Contact programmatically
// Get the Contact in session
var contact = Tracker.Current.Session.Contact;
// Set the Contact's identification level to known if not already set
if (contact.Identifiers.IdentificationLevel != ContactIdentificationLevel.Known)
contact.Identifiers.IdentificationLevel = ContactIdentificationLevel.Known;
// Set the Email address entered into the form as the Identifier of the Contact
contact.Identifiers.Identifier = OrderFormModel.EmailAddress;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment