Example #1
0
        private void GenerateActivities(
            string campaignName,
            IReadOnlyDictionary <string, IEnumerable <ActivityDataParameters> > conversionHits,
            int contactsCount)
        {
            var siteName     = _mSite.SiteName;
            var campaignInfo = CampaignInfoProvider.GetCampaignInfo(campaignName, siteName);
            var posterPath   = CampaignDataGeneratorHelpers.GetDocument(PagePathAmericasCoffeePoster);
            var colombiaPath = CampaignDataGeneratorHelpers.GetDocument(PagePathColombia);
            var bizFormInfo  = BizFormInfoProvider.GetBizFormInfo(TryFreeSampleFormCodeName, _mSite.SiteID);

            CampaignDataGeneratorHelpers.DeleteOldActivities(campaignInfo.CampaignUTMCode);
            var contactsIDs = new ContactsIdData(_contactEmailPostfix, contactsCount);

            CampaignDataGeneratorHelpers.GenerateActivities(conversionHits[ConversionPagevisitColombia], campaignInfo,
                                                            "pagevisit",
                                                            contactsIDs, colombiaPath.NodeID);

            CampaignDataGeneratorHelpers.GenerateActivities(conversionHits[ConversionPagevisitAmericasCoffeePoster],
                                                            campaignInfo,
                                                            "pagevisit", contactsIDs, posterPath.NodeID);

            CampaignDataGeneratorHelpers.GenerateActivities(conversionHits[ConversionUserregistration], campaignInfo,
                                                            "userregistration", contactsIDs);

            CampaignDataGeneratorHelpers.GenerateActivities(conversionHits[ConversionFormsubmissionTryFreeSample],
                                                            campaignInfo,
                                                            "bizformsubmit", contactsIDs, bizFormInfo.FormID);
        }
Example #2
0
        public static void GenerateActivities(
            IEnumerable <ActivityDataParameters> activityDataParameters,
            CampaignInfo campaign,
            string type,
            ContactsIdData contactsIDs,
            int conversionItemId = 0)
        {
            var nodeId = 0;
            var itemId = 0;

            if (type == "pagevisit")
            {
                nodeId = conversionItemId;
            }
            else
            {
                itemId = conversionItemId;
            }

            foreach (var activityDataParameter in activityDataParameters)
            {
                for (var index = 0; index < activityDataParameter.Count; ++index)
                {
                    GenerateFakeActivity(campaign.CampaignUTMCode, type, activityDataParameter, nodeId, itemId, campaign.CampaignSiteID, contactsIDs.GetNextContactId());
                }
            }
        }