0

我需要将电子商务交易发送到 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);
        }
4

1 回答 1

0

看看验证命中。

要将命中发送到 Measurement Protocol Validation Server,请使用端点 /debug/collect 而不是 /collect

请参阅:https ://developers.google.com/analytics/devguides/collection/protocol/v1/validating-hits

于 2016-01-15T15:39:57.067 回答