Exemple #1
0
        public static IUTEvent GetEvent(this Interaction interaction)
        {
            //GoalType type = (GoalType)Enum.Parse(typeof(GoalType), interaction.GoalId);

            var ev = new UTEvent(interaction.Timestamp, new Dictionary <string, string>()
            {
                { "CustomerId", interaction.CustomerId.ToString() }
            },
                                 definitionId, itemId, interaction.GoalValue, "", "", new TimeSpan(3000), Guid.NewGuid().ToString());

            return(new UTGoal(ev));
        }
        public IEventRequestParametersBuilder <T> ItemId(string itemId)
        {
            BaseValidator.CheckForTwiceSetAndThrow(this.EventParametersAccumulator.ItemId,
                                                   this.GetType().Name + ".itemId");

            this.EventParametersAccumulator = new UTEvent(
                this.EventParametersAccumulator.Timestamp,
                this.EventParametersAccumulator.CustomValues,
                this.EventParametersAccumulator.DefinitionId,
                itemId,
                this.EventParametersAccumulator.EngagementValue,
                this.EventParametersAccumulator.ParentEventId,
                this.EventParametersAccumulator.Text,
                this.EventParametersAccumulator.Duration,
                this.EventParametersAccumulator.TrackingInteractionId
                );

            return(this);
        }
        private IUTEvent ApplyDeviceIdentifier(IUTEvent utEvent)
        {
            string deviceInfoKey   = UTGrammar.UTV1Grammar().DeviceIdentifierKeyValue;
            string deviceInfoValue = null;

            Dictionary <string, string> mergedCustomValues = utEvent.CustomValues;

            if (mergedCustomValues == null)
            {
                mergedCustomValues = new Dictionary <string, string>();
            }

            if (mergedCustomValues.ContainsKey(deviceInfoKey))
            {
                deviceInfoValue = mergedCustomValues[deviceInfoKey];
            }

            if (this.defaultDeviceIdentifier == null || deviceInfoValue != null)
            {
                return(utEvent);
            }

            mergedCustomValues.Add(deviceInfoKey, this.defaultDeviceIdentifier);

            IUTEvent mergedEvent = new UTEvent(
                utEvent.Timestamp,
                mergedCustomValues,
                utEvent.DefinitionId,
                utEvent.ItemId,
                utEvent.EngagementValue,
                utEvent.ParentEventId,
                utEvent.Text,
                utEvent.Duration,
                utEvent.TrackingInteractionId,
                utEvent.type
                );

            return(mergedEvent);
        }
        private IUTEvent ApplyActiveInteraction(IUTEvent utEvent, IUTSessionConfig sessionConfig)
        {
            if (utEvent.TrackingInteractionId != null || sessionConfig.ActiveInteractionId == null)
            {
                return(utEvent);
            }

            IUTEvent mergedEvent = new UTEvent(
                utEvent.Timestamp,
                utEvent.CustomValues,
                utEvent.DefinitionId,
                utEvent.ItemId,
                utEvent.EngagementValue,
                utEvent.ParentEventId,
                utEvent.Text,
                utEvent.Duration,
                sessionConfig.ActiveInteractionId,
                utEvent.type
                );

            return(mergedEvent);
        }