static AnalyticsManager() { //anonymise the machine name so it's not too stalkery anonymousUserID = GetHashString(Environment.MachineName); userProperties = new Segment.Model.Properties() { {"version",UpdateManager.CurrentVersion}, {"game",GameConfigurationManager.GameConfiguration.Name} }; options = new Options {Context = {{"direct", true}}}; }
static AnalyticsManager() { anonymousUserID = getUniqueComputerID(); userProperties = new Segment.Model.Properties() { { "version", UpdateManager.CurrentVersion }, { "game", GameConfigurationManager.GameConfiguration.Name } }; options = new Options { Context = { { "direct", true } } }; }
public void Track(UserDO userDO, String eventName, Dictionary<String, object> properties = null) { var props = new Segment.Model.Properties(); foreach (var prop in GetProperties(userDO)) props.Add(prop.Key, prop.Value); if (properties != null) { foreach (var prop in properties) props[prop.Key] = prop.Value; } Analytics.Client.Track(userDO.Id, eventName, props); }
static AnalyticsManager() { //anonymise the machine name so it's not too stalkery anonymousUserID = GetHashString(Environment.MachineName); userProperties = new Segment.Model.Properties() { { "version", UpdateManager.CurrentVersion }, { "game", GameConfigurationManager.GameConfiguration.Name } }; options = new Options { Context = { { "direct", true } } }; }
public void Identify(Fr8AccountDO fr8AccountDO) { if (Analytics.Client == null) { return; } var props = new Segment.Model.Properties(); foreach (var prop in GetProperties(fr8AccountDO)) { props.Add(prop.Key, prop.Value); } Analytics.Client.Identify(fr8AccountDO.Id, GetProperties(fr8AccountDO)); //Analytics.Client.Track(fr8AccountDO.Id, "User Logged In", props); }
//https://segment.com/docs/integrations/mixpanel/#identify //For Mixpanel People, it’s important to identify a user before you call track. //A track without an identify won’t create a user in Mixpanel People. public void Track(Fr8AccountDO fr8AccountDO, string eventName, Dictionary <string, object> properties = null) { if (Analytics.Client == null) { return; } var props = new Segment.Model.Properties(); foreach (var prop in GetProperties(fr8AccountDO)) { props.Add(prop.Key, prop.Value); } if (properties != null) { foreach (var prop in properties) { props[prop.Key] = prop.Value; } } Analytics.Client.Identify(fr8AccountDO.Id, GetProperties(fr8AccountDO)); Analytics.Client.Track(fr8AccountDO.Id, eventName, props); }