public void send(Event event) throws MetricsException {
    HttpPost request = new HttpPost(MetricsUtils.GA_ENDPOINT_URL);
    request.setEntity(MetricsUtils.buildPostBody(event, analyticsId, random));
    try {
      client.execute(request, RESPONSE_HANDLER);
    } catch (IOException e) {
      // All errors in the request execution, including non-2XX HTTP codes,
      // will throw IOException or one of its subclasses.
      throw new MetricsCommunicationException("Problem sending request to server", e);
    }
  }
public void send ( Event event ) throws MetricsException { HttpPost request = new HttpPost ( MetricsUtils . GA_ENDPOINT_URL ) ; request . setEntity ( MetricsUtils . buildPostBody ( event , analyticsId , random ) ) ; try { client . execute ( request , RESPONSE_HANDLER ) ; } catch ( IOException e ) { throw new MetricsCommunicationException ( "Problem sending request to server" , e ) ; } }
Translates an encapsulated event into a request to the Google Analytics API and sends the
resulting request.