public KnownData GetKnownDataViaTracker(Sitecore.Analytics.Tracking.Contact trackingContact)
        {
            KnownData toReturn = null;

            using (XConnectClient xConnectClient = Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient())
            {
                try
                {
                    toReturn = new KnownData();

                    var xConnectHelper = new XConnectHelper(AllFacetKeys);

                    IdentifiedContactReference IdentifiedContactReference = xConnectHelper.GetIdentifierFromTrackingContact(trackingContact);

                    Contact XConnectContact = xConnectHelper.IdentifyKnownContact(IdentifiedContactReference);

                    XConnectFacets = Tracker.Current.Contact.GetFacet <IXConnectFacets>("XConnectFacets");

                    toReturn.FacetData = GatherFacetData(XConnectFacets);

                    toReturn.KnownInteractions = GetKnownInteractions(XConnectContact, xConnectClient);

                    toReturn.Identifiers = Tracker.Current.Contact.Identifiers.ToList();
                }
                catch (XdbExecutionException ex)
                {
                    Sitecore.Diagnostics.Log.Error(CollectionConst.Logger.Prefix + ex.Message, this);
                }
            }

            return(toReturn);
        }
 public void AppendCurrentContextData(KnownData knownDataXConnect, Database database)
 {
     if (knownDataXConnect != null && database != null)
     {
         foreach (var interaction in knownDataXConnect.KnownInteractions)
         {
             if (interaction.ChannelId != Guid.Empty)
             {
                 interaction.ChannelName = GetDisplayName(interaction.ChannelId);
                 interaction.Events      = interaction.Events;
             }
             else
             {
                 Sitecore.Diagnostics.Log.Error($"Interaction guid was empty", this);
             }
         }
     }
 }
        public KnownData GetKnownDataFromTrackingContact()
        {
            var toReturn = new KnownData();

            return(toReturn);
        }