// GET: DigitalCameraSkuContent public ActionResult Index(GenericSizeVariationContent currentContent) { if (currentContent == null) { throw new ArgumentNullException("currentContent"); } IVariationViewModel <GenericSizeVariationContent> viewModel = CreateVariationViewModel <GenericSizeVariationContent>(currentContent); viewModel.Media = GetMedia(currentContent); viewModel.PriceViewModel = GetPriceModel(currentContent); viewModel.AllVariationSameStyle = CreateRelatedVariationViewModelCollection(currentContent, Constants.AssociationTypes.SameStyle); if (viewModel.RelatedProductsContentArea == null) { viewModel.RelatedProductsContentArea = CreateRelatedProductsContentArea(currentContent, Constants.AssociationTypes.Default); } viewModel.CartItem = new CartItemModel(currentContent) { CanBuyEntry = true }; TrackAnalytics(viewModel); viewModel.IsSellable = IsSellable(currentContent); return(View(viewModel)); }
protected void TrackAnalytics(IVariationViewModel <GenericSizeVariationContent> viewModel) { // Track GoogleAnalyticsTracking tracking = new GoogleAnalyticsTracking(ControllerContext.HttpContext); tracking.ClearInteractions(); // Track the main product view tracking.ProductAdd( viewModel.CatalogContent.Code, viewModel.CatalogContent.DisplayName, null, null, null, null, 0, (double)viewModel.CatalogContent.GetDefaultPriceAmount(_currentMarket.GetCurrentMarket()), 0 ); // TODO: Track related products as impressions // Track action as details view tracking.Action("detail"); }