title: How to stop Google Analytics default query timeout (60 seconds I believe)
body: <p>I'm using Pentaho Data Integration, an open source ETL/ data transfer tool.</p>
  
  <p>The tool is built on java and uses a service account &amp; key file to make requests to the Google Analytics API.</p>
  
  <p>Problem is --- the Google Analytics API seems to have a default server side timeout of exactly 60 seconds before it stops and errors out.</p>
  
  <p>Now, I did come across the following info to extend the timeout:</p>
  
  <pre><code> private HttpRequestInitializer setHttpTimeout(final HttpRequestInitializer requestInitializer) {
    return new HttpRequestInitializer() {
      @Override
      public void initialize(HttpRequest httpRequest) throws IOException {
        requestInitializer.initialize(httpRequest);
        httpRequest.setConnectTimeout(3 * 60000);  // 3 minutes connect timeout
        httpRequest.setReadTimeout(3 * 60000);  // 3 minutes read timeout
      }
    };
  
  GoogleCredential credential = ....
  
  final Analytics analytics = Analytics.builder(new NetHttpTransport(), jsonFactory, setHttpTimeout(credential)).build();
  </code></pre>
  
  <p>Only problem is that I'm not exactly sure how to implement this in conjunction with the 3rd party tool PDI --- I can execute a stand alone Java code - but I'm not exactly sure if the above script will permanently increase the timeout duration for a given account, or only for the session.</p>
  
  <p>Is there any simple way to extend the timeout for Google Analytics for an account without necessarily executing complicated code?</p>
  
  <p>If not, how exactly do I use the above code snippet?</p>