Ejemplo n.º 1
0
        public static void CampaignsDownloaded(List <SwrveQaUserCampaignInfo> campaignInfoList)
        {
            if (!CanLog())
            {
                return;
            }

            try {
                List <Dictionary <string, object> > logDetailsCampaignsList = new List <Dictionary <string, object> >();
                for (int i = 0; i < campaignInfoList.Count; ++i)
                {
                    SwrveQaUserCampaignInfo     qaUserCampaignInfo  = campaignInfoList[i];
                    Dictionary <string, object> logDetailsCampaigns = new Dictionary <string, object>();
                    logDetailsCampaigns.Add("id", qaUserCampaignInfo.id);
                    logDetailsCampaigns.Add("variant_id", qaUserCampaignInfo.variantId);
                    logDetailsCampaigns.Add("type", qaUserCampaignInfo.type);
                    logDetailsCampaignsList.Add(logDetailsCampaigns);
                }

                Dictionary <string, object> logDetails = new Dictionary <string, object>();
                logDetails.Add("campaigns", logDetailsCampaignsList);

                SwrveQaUser qaUser = SwrveQaUser.Instance;
                qaUser.QueueQaLogEvent("campaigns-downloaded", logDetails);
            } catch (Exception ex) {
                SwrveLog.LogError("SwrveQaUser: CampaignsDownloaded exception:" + ex.ToString());
            }
        }
Ejemplo n.º 2
0
        private void CampaignTriggered(string eventName, IDictionary <string, string> eventPayload, bool displayed, string reason, List <SwrveQaUserCampaignInfo> campaignInfoList = null)
        {
            Dictionary <string, object> logDetails = new Dictionary <string, object>();

            logDetails.Add("event_name", eventName);
            if (eventPayload == null)
            {
                eventPayload = new Dictionary <string, string>();
            }

            if (campaignInfoList == null)
            {
                campaignInfoList = new List <SwrveQaUserCampaignInfo>();
            }

            logDetails.Add("event_payload", eventPayload);
            logDetails.Add("displayed", displayed);
            logDetails.Add("reason", reason);

            List <Dictionary <string, object> > logDetailsCampaignsList = new List <Dictionary <string, object> >();

            for (int i = 0; i < campaignInfoList.Count; ++i)
            {
                SwrveQaUserCampaignInfo     qaUserCampaignInfo  = campaignInfoList[i];
                Dictionary <string, object> logDetailsCampaigns = new Dictionary <string, object>();
                logDetailsCampaigns.Add("id", qaUserCampaignInfo.id);
                logDetailsCampaigns.Add("variant_id", qaUserCampaignInfo.variantId);
                logDetailsCampaigns.Add("type", qaUserCampaignInfo.type);
                logDetailsCampaigns.Add("displayed", qaUserCampaignInfo.displayed);
                logDetailsCampaigns.Add("reason", qaUserCampaignInfo.reason);
                logDetailsCampaignsList.Add(logDetailsCampaigns);
            }
            logDetails.Add("campaigns", logDetailsCampaignsList);

            SwrveQaUser qaUser = SwrveQaUser.Instance;

            qaUser.QueueQaLogEvent("campaign-triggered", logDetails);
        }