Installing Google-Analytics-export-to-CSV

January 31st, 2012 by Yali

The Google-export-to-csv blog post series

Google-Analytics-export-to-CSV is a straightforward, command-line tool for getting data out of Google Analytics (via the API) and into a CSV file, so you can open it in your favourite analytics program.

For an introduction, see here. For instructions on how to use the tool to run queries and extract data, see here. The program can be downloaded here. It is packaged as a ZIP file. It only needs to be unzipped before it can be used at the command line.

The program requires Java to run. If you do not have Java runtime environment installed, you will need to install it.  The following is a step-by-step guide to install Google-Analytics-export-to-CSV (incl. Java if necessary) and run your first query:

1. Check if you have the Java Runtime Environment installed

If you’re running an Apple Mac, chances are you already have the Java runtime environment on your machine, as Apple kindly bundles this with all Mac’s. If you want to check, open up the Terminal (go to Applications, and then open Utilies. The Terminal can be found there.) Double click on the terminal and type java at the command prompt. You should see something like the following:

If you are running a Windows machine, you may not have Java installed. To check:

  1. Open the Windows PowerShell
    • Click on the Start Menu and select “All Programs”
    • Open the “Accessories” folder
    • Select “Windows PowerShell”
  2. Type java at the command line and press enter. If Java is installed you should see something like the following screen shot. If you receive an error, it means Java is probably not installed on your machine:
2. Install Java if you do not already have it
  1. Go to the Java download page: http://www.java.com/en/download/manual.jsp
  2. Select either the 32-bit or 64-bit Windows version
    • If you are unsure, right click on “My computer”, choose “Properties” and see what “System type” you have (See the below screenshot for an example)
  3. If prompted, elect to save the selected version. It will now download. (The name of the file download will be something like jre-6u30-windows-x64.exe
  4. Once the file has been downloaded, double click it to run it. This will launch the setup wizardThe setup wizard should not ask for any choices / options. On completing, it will close
  5. To check that the installation was successful, open the Windows PowerShell and type “java” at the command prompt. You should see a screen like the following:

3. Download the Google-Analytics-export-to-CSV zip file
You can do that be clicking here. Unzip the zip file into a suitable location on your hard drive.

4. Run a sample query

Specific instructions on developing and executing queries is given in this blog post.

Leave a Reply