0

I need to send ECommerce transactions to Google Analytics. I've tried just about everything I can think of to get it to work, but I always get a GIF89a response. Can anyone help me troubleshoot this?

        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);
        }
  • As far as I can tell the GA endpoint always returns a gif, so I don't think this is actually an error. – Eike Pierstorff Aug 20 '14 at 08:27
  • Hi Eike, in that case is there some delay between transactions appearing in your dashboard? None of the Transactions I've sent over the last several hours have shown up in my GA dashboard. – user1037563 Aug 20 '14 at 08:56
  • 1
    As per documentation: "Processing latency is 24-48 hours. Standard accounts that send more than 200,000 sessions per day to Google Analytics will result in the reports being refreshed only once a day." . Plus when processing starts depends on the selected timezone in your account. Actually with small accounts data usually shows up qicker, but it will take at least several hours before you will see something (especially since transaction seem to take longer than simple values like pageviews etc). – Eike Pierstorff Aug 20 '14 at 09:06

1 Answers1

0

Have a look at validating hits.

To send hits to the Measurement Protocol Validation Server use the endpoint /debug/collect instead of /collect

See: https://developers.google.com/analytics/devguides/collection/protocol/v1/validating-hits