Ejemplo n.º 1
0
        private bool CheckIfCurrentDomainHasMatchForCurrentUrl(DealFinderContext context, List <string> domainTriggers)
        {
            foreach (dynamic trigger in domainTriggers)
            {
                Match match = Match.Empty;

                try
                {
                    match = Regex.Match(context.Url, trigger);
                }
                catch (Exception ex)
                {
                    context.AddDebug("Bad Trigger !", trigger);
                }

                if (match.Success)
                {
                    context.CurrentTrigger = trigger;
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        private void AddDebugParameters(DealFinderContext context)
        {
            context.AddDebug("Time Stamp", DateTime.Now.ToString());
            context.AddDebug("Url", context.Url);
            context.AddDebug("Trigger", context.CurrentTrigger);
            context.AddDebug("Campaign ID", context.CampaignId);
            context.AddDebug("GUID", context.NewUserId);
            context.AddDebug("Impression ID", context.NewImpressionId);
            context.AddDebug("Domain", context.DomainName);
            context.AddDebug("Is Domain In DataBase?", context.IsDomainInDataBase ? "Yes" : "No");
            context.AddDebug("Page Type", context.PageType);
            context.AddDebug("Country", context.Country);
            context.AddDebug("SKU", context.CachedValue);
            context.AddDebug("SKU in PCM?", context.IsExistInPcm ? "Yes" : "No");
            context.AddDebug("Is Get Site Data Executed?", context.IsGetSiteDataExecuted ? "Yes" : "No");
            context.AddDebug("Is Get Site Data Failed?", context.IsGetSiteDataFailed ? "Yes" : "No");
            context.AddDebug("Product Name", context.ProductName);
            context.AddDebug("Product Price", context.Price.ToString());
            context.AddDebug("Domain Price Rule", context.DomainPriceRule);
            context.AddDebug("Currency", context.Currency);
            context.AddDebug("SKU Optimized By", JsonConvert.SerializeObject(context.CseOptimizationMapping));
            context.AddDebug("Pre Filtered Products", JsonConvert.SerializeObject(context.CseNumberOfRawResults));
            context.AddDebug("Total Offers Available To Display", context.TotalNumberOfOffersToDisplay.ToString());
            context.AddDebug("CSE Call Status", JsonConvert.SerializeObject(context.CseExecutionFailure));

            context.AddDebug("Is Retargeting Enabled", context.IsRetargetingEnabled ? "Yes" : "No");
            context.AddDebug("Is Retargeting Result", context.IsRetargetingResult ? "Yes" : "No");
            context.AddDebug("Is eCommerce Domain", context.IsEcommerceDomain ? "Yes" : "No");
            context.AddDebug("eCommerce Recency", context.EcommerceRecency);
            context.AddDebug("Non eCommerce Recency", context.NonEcommerceRecency);
            context.AddDebug("Non eCommerce Frequency", context.NonEcommerceFrequency);
        }