コード例 #1
0
        public void TrackAfterPayment(ReceiptViewModel model)
        {
            // Track Analytics
            var tracking = new GoogleAnalyticsTracking(_contextProvider.GetContext());

            // Add the products
            int i = 1;
            foreach (var orderLine in model.Order.OrderLines)
            {
                if (string.IsNullOrEmpty(orderLine.Code) == false)
                {
                    tracking.ProductAdd(code: orderLine.Code,
                        name: orderLine.Name,
                        quantity: orderLine.Quantity,
                        price: (double)orderLine.Price,
                        position: i
                        );
                    i++;
                }
            }

            // And the transaction itself
            tracking.Purchase(model.Order.OrderNumber,
                null, (double)model.Order.TotalAmount, (double)model.Order.Tax, (double)model.Order.Shipping);
        }
コード例 #2
0
 public void TrackPromotionImpression(string id, string name, string bannerName)
 {
     var tracking = new GoogleAnalyticsTracking(_contextProvider.GetContext());
     tracking.PromotionImpression(id, name, bannerName);
 }
コード例 #3
0
 public string GetPromotionClickScript(string id, string name, string bannerName)
 {
     var tracking = new GoogleAnalyticsTracking(_contextProvider.GetContext());
     return tracking.PromotionClickScript(id, name, bannerName);
 }