Ejemplo n.º 1
0
        public async Task TestConvertEventToQueryParams()
        {
            var googleAnalytics = new GoogleAnalytics(TEST_APP_KEY, NewInMemoryStore())
            {
                url = GoogleAnalytics.DEBUG_ENDPOINT // Use the debug endpoint
            };
            var e           = googleAnalytics.NewEvent("cat1", "action1", "label1", value: 123);
            var queryParams = RestRequestHelper.ToUriEncodedString(e);
            var fullUrl     = googleAnalytics.url + "?" + queryParams;
            var res         = await new Uri(fullUrl).SendGET().GetResult <GoogleAnalyticsDebugResp>();

            Assert.True(res.hitParsingResult.First().valid, JsonWriter.AsPrettyString(res));
        }
Ejemplo n.º 2
0
 // https://cloud.google.com/appengine/docs/flexible/nodejs/integrating-with-analytics#server-side_analytics_collection
 public RestRequest SendToGA(BaseMsg parameters)
 {
     return(new Uri(url + "?" + RestRequestHelper.ToUriEncodedString(parameters)).SendGET());
 }