示例#1
0
        public AdTraceSessionFailure(Dictionary <string, string> sessionFailureDataMap)
        {
            if (sessionFailureDataMap == null)
            {
                return;
            }

            Adid      = AdTraceUtils.TryGetValue(sessionFailureDataMap, AdTraceUtils.KeyAdid);
            Message   = AdTraceUtils.TryGetValue(sessionFailureDataMap, AdTraceUtils.KeyMessage);
            Timestamp = AdTraceUtils.TryGetValue(sessionFailureDataMap, AdTraceUtils.KeyTimestamp);

            bool willRetry;

            if (bool.TryParse(AdTraceUtils.TryGetValue(sessionFailureDataMap, AdTraceUtils.KeyWillRetry), out willRetry))
            {
                WillRetry = willRetry;
            }

            string jsonResponseString = AdTraceUtils.TryGetValue(sessionFailureDataMap, AdTraceUtils.KeyJsonResponse);
            var    jsonResponseNode   = JSON.Parse(jsonResponseString);

            if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
            {
                JsonResponse = new Dictionary <string, object>();
                AdTraceUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
            }
        }
示例#2
0
        public AdTraceAttribution(Dictionary <string, string> dicAttributionData)
        {
            if (dicAttributionData == null)
            {
                return;
            }

            trackerName  = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyTrackerName);
            trackerToken = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyTrackerToken);
            network      = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyNetwork);
            campaign     = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyCampaign);
            adgroup      = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyAdgroup);
            creative     = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyCreative);
            clickLabel   = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyClickLabel);
            adid         = AdTraceUtils.TryGetValue(dicAttributionData, AdTraceUtils.KeyAdid);
        }
示例#3
0
        public AdTraceSessionSuccess(Dictionary <string, string> sessionSuccessDataMap)
        {
            if (sessionSuccessDataMap == null)
            {
                return;
            }

            Adid      = AdTraceUtils.TryGetValue(sessionSuccessDataMap, AdTraceUtils.KeyAdid);
            Message   = AdTraceUtils.TryGetValue(sessionSuccessDataMap, AdTraceUtils.KeyMessage);
            Timestamp = AdTraceUtils.TryGetValue(sessionSuccessDataMap, AdTraceUtils.KeyTimestamp);

            string jsonResponseString = AdTraceUtils.TryGetValue(sessionSuccessDataMap, AdTraceUtils.KeyJsonResponse);
            var    jsonResponseNode   = JSON.Parse(jsonResponseString);

            if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
            {
                JsonResponse = new Dictionary <string, object>();
                AdTraceUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
            }
        }