我需要将电子商务交易发送到 Google Analytics。我已经尝试了几乎所有我能想到的让它工作,但我总是得到一个 GIF89a 响应。谁能帮我解决这个问题?
using (var wb = new WebClient())
{
var data = new NameValueCollection();
data["v"] = "1";
data["tid"] = "UA-XXXXXXXX-1";
data["cid"] = Guid.NewGuid().ToString();
data["t"] = "transaction";
data["ti"] = "12345";
data["tr"] = "125.00";
data["ts"] = "25.00";
data["tt"] = "10.00";
data["cu"] = "ZAR";
data["an"] = "dkFosTest";
//var url = @"http://www.google-analytics.com/collect";
var url = @"https://ssl.google-analytics.com/collect";
var response = wb.UploadValues(url, data);
var stringResponse = System.Text.Encoding.UTF8.GetString(response);
}