Identify() public method

Identifying a visitor ties all of their actions to an ID you recognize and records visitor traits you can segment by.
public Identify ( string userId, Traits traits ) : void
userId string The visitor's identifier after they log in, or you know /// who they are. By /// explicitly identifying a user, you tie all of their actions to their identity.
traits Segmentio.Model.Traits A dictionary with keys like "email", "name", “subscriptionPlan” or /// "friendCount”. You can segment your users by any trait you record. /// Pass in values in key-value format. String key, then its value /// { String, Integer, Boolean, Double, or Date are acceptable types for a value. }
return void
示例#1
0
 public static void Identify(Client client)
 {
     client.Identify(userId, new Traits() {
             { "Subscription Plan", "Free" },
             { "Friends", 30 },
             { "Joined", DateTime.Now },
             { "Cool", true },
             { "Company", new Props() { { "name", "Initech, Inc " } } },
             { "Revenue", 40.32 },
             { "Don't Submit This, Kids", new UnauthorizedAccessException() } },
                 new DateTime(),
                 new Context()
                     .SetIp("12.212.12.49")
                     .SetLanguage("en-us")
                     .SetProviders(new Providers() {
                         { "all", false },
                         { "Mixpanel", true },
                         { "Salesforce", true }
                     })
             );
 }