private string GetCampaign() { var campaignId = _trackerBuilder.Tracker.Interaction.CampaignId; if (campaignId != null) { var campaign = _sitecoreRepository.GetItem(campaignId.ToString()); if (campaign != null) { return(campaign.Name); } else { return(campaignId.ToString()); } } return(null); }
private Goal[] GetGoals(int numberOfGoals) { if (Tracker.CurrentVisit != null) { // TODO: Query the Sitecore Context rather than doing a join on the tables var pageEvents = Tracker.Visitor.DataContext.PageEvents .Where(x => _sitecoreRepository.IsGoal(x.PageEventDefinitionId)) .OrderByDescending(x => x.DateTime) .Take(numberOfGoals) .Select(x => new Goal { Name = _sitecoreRepository.GetItem(x.PageEventDefinitionId).Name, Timestamp = x.DateTime }); return(pageEvents.ToArray()); } return(null); }
public Item GetItem(string itemId) { return(_wrappedRepository.GetItem(itemId)); }