Skip to content

Commit

Permalink
Hooked up EventRequest in CreateRequest method (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
looq authored and ion-sapoval committed Sep 14, 2016
1 parent 851b480 commit d62551e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/GoogleMeasurementProtocol/GoogleAnalyticsRequestFactory.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Net;
using GoogleMeasurementProtocol.Parameters;
using GoogleMeasurementProtocol.Parameters;
using GoogleMeasurementProtocol.Parameters.General;
using GoogleMeasurementProtocol.Requests;
using System;
using System.Collections.Generic;
using System.Net;

namespace GoogleMeasurementProtocol
{
Expand Down Expand Up @@ -43,18 +43,23 @@ public IGoogleAnalyticsRequest CreateRequest(string hitType, IEnumerable<Paramet
{
if (hitType == null)
{
throw new ArgumentNullException("hitType");
throw new ArgumentNullException("hitType");
}

IGoogleAnalyticsRequest request;

switch (hitType.ToLower())
{
case HitTypes.PageView :
case HitTypes.PageView:

request = new PageViewRequest(_useSsl, _proxy);
break;

case HitTypes.Event:

request = new EventRequest(_useSsl, _proxy);
break;

default:
throw new ApplicationException("Unknown hitType: " + hitType);
}
Expand Down

0 comments on commit d62551e

Please sign in to comment.