public PersonSetEvent CreatePersonSetEvent()
        {
            this.AssertValidProjectToken();
            var personEvent = new PersonSetEvent();

            this.OnCreatePersonEvent(personEvent);
            return(personEvent);
        }
        public PersonSetEvent CreatePersonSetEvent(String distinctId)
        {
            this.AssertValidProjectToken();
            var personEvent = new PersonSetEvent();

            personEvent.DistinctUserId = distinctId;
            this.OnCreatePersonEvent(personEvent);
            return(personEvent);
        }
Exemplo n.º 3
0
        protected virtual void WriteSetJson(JsonWriter writer, PersonSetEvent personEvent)
        {
            // https://mixpanel.com/docs/people-analytics/people-http-specification-insert-data
            //{
            //    "$set": {
            //        "$first_name": "John",
            //        "$last_name": "Smith"
            //    },
            //    "$token": "36ada5b10da39a1347559321baf13063",
            //    "$distinct_id": "13793",
            //    "$ip": "123.123.123.123"
            //}

            writer.WriteStartObject();
            this.WriteCommonPersonValues(writer, personEvent);
            writer.WritePropertyName("$set");
            writer.WriteRawValue(personEvent.Properties.ToPropertyArrayJson(Formatting.None) ?? "{}");
            writer.WriteEnd();
        }
 protected virtual void OnCreatePersonEvent(PersonSetEvent personEvent)
 {
     personEvent.ProjectToken = this.ProjectToken;
 }