Ejemplo n.º 1
0
        public AdTraceSessionFailure(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            Adid      = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyAdid);
            Message   = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyMessage);
            Timestamp = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyTimestamp);
            WillRetry = Convert.ToBoolean(AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyWillRetry));

            var jsonResponseNode = jsonNode[AdTraceUtils.KeyJsonResponse];

            if (jsonResponseNode == null)
            {
                return;
            }
            if (jsonResponseNode.AsObject == null)
            {
                return;
            }

            JsonResponse = new Dictionary <string, object>();
            AdTraceUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
        }
        public AdTraceEventSuccess(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            Adid       = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyAdid);
            Message    = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyMessage);
            Timestamp  = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyTimestamp);
            EventToken = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyEventToken);
            CallbackId = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyCallbackId);

            var jsonResponseNode = jsonNode[AdTraceUtils.KeyJsonResponse];

            if (jsonResponseNode == null)
            {
                return;
            }
            if (jsonResponseNode.AsObject == null)
            {
                return;
            }

            JsonResponse = new Dictionary <string, object>();
            AdTraceUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
        }
Ejemplo n.º 3
0
        public AdTraceAttribution(string jsonString)
        {
            var jsonNode = JSON.Parse(jsonString);

            if (jsonNode == null)
            {
                return;
            }

            trackerName  = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyTrackerName);
            trackerToken = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyTrackerToken);
            network      = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyNetwork);
            campaign     = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyCampaign);
            adgroup      = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyAdgroup);
            creative     = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyCreative);
            clickLabel   = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyClickLabel);
            adid         = AdTraceUtils.GetJsonString(jsonNode, AdTraceUtils.KeyAdid);
        }