Exemple #1
0
        private void Track(string eventName, double revenue = 0, string currency = null, string refId = null, List <MATEventItem> eventItems = null)
        {
            string action = "conversion";

            // Don't send close events
            if (eventName.Equals("close"))
            {
                return;
            }
            if (eventName.Equals("open") || eventName.Equals("install") || eventName.Equals("update") || eventName.Equals("session"))
            {
                action = "session";
            }

            if (revenue > 0)
            {
                parameters.IsPayingUser = true;
            }

            //Create hard copy of fields before making async tracking request
            Parameters copy = parameters.Copy();

            eventQueue.ProcessTrackingRequest(action, eventName, revenue, currency, refId, eventItems, copy);

            if (parameters.matResponse != null)
            {
                parameters.matResponse.EnqueuedActionWithRefId(refId);
            }

            parameters.EventContentType  = null;
            parameters.EventContentId    = null;
            parameters.EventLevel        = 0;
            parameters.EventQuantity     = 0;
            parameters.EventSearchString = null;
            parameters.EventRating       = 0.0;
            parameters.EventDate1        = null;
            parameters.EventDate2        = null;
            parameters.EventAttribute1   = null;
            parameters.EventAttribute2   = null;
            parameters.EventAttribute3   = null;
            parameters.EventAttribute4   = null;
            parameters.EventAttribute5   = null;
        }
Exemple #2
0
        private void Track(string eventName, double revenue = 0, string currency = null, string refId = null, List <MATEventItem> eventItems = null)
        {
            string action = "conversion";

            // Don't send close events
            if (eventName.Equals("close"))
            {
                return;
            }
            if (eventName.Equals("open") || eventName.Equals("install") || eventName.Equals("update") || eventName.Equals("session"))
            {
                action = "session";
            }

            if (revenue > 0)
            {
                parameters.IsPayingUser = true;
            }

            //Add to queue and process building operation in separate thread.
            //Copy is required because of async
            Parameters copy = parameters.Copy();

            eventQueue.ProcessTrackingRequest(action, eventName, revenue, currency, refId, eventItems, copy);

            parameters.EventContentType  = null;
            parameters.EventContentId    = null;
            parameters.EventLevel        = 0;
            parameters.EventQuantity     = 0;
            parameters.EventSearchString = null;
            parameters.EventRating       = 0.0;
            parameters.EventDate1        = null;
            parameters.EventDate2        = null;
            parameters.EventAttribute1   = null;
            parameters.EventAttribute2   = null;
            parameters.EventAttribute3   = null;
            parameters.EventAttribute4   = null;
            parameters.EventAttribute5   = null;
        }