Пример #1
0
        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}}};
        }
Пример #2
0
        static AnalyticsManager()
        {
            anonymousUserID = getUniqueComputerID();

            userProperties = new Segment.Model.Properties()
            {
                { "version", UpdateManager.CurrentVersion },
                { "game", GameConfigurationManager.GameConfiguration.Name }
            };

            options = new Options {
                Context = { { "direct", true } }
            };
        }
Пример #3
0
        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);
        }
Пример #4
0
        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 } }
            };
        }
Пример #5
0
        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);
        }
Пример #6
0
        //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);
        }