Пример #1
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);
        }
Пример #2
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);
        }
Пример #3
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);
        }