Google Analytics Via Google Spreadsheet


datapine offers a built-in connector to Google Analytics to automatically pull in your website data. However, if you wish to perform more advanced calculations or cross queries on this data you will need to pull those metrics from Google Analytics into a Google Spreadsheet and connect this to datapine. Please use this guideline to learn how to setup a Google Analytics Report in Google Drive and how to get your data from Google Analytics into datapine using a Google Spreadsheet.



Get the Google Analytics Add-on


  1. Login to Google Drive with a user that also has access rights to your Google Analytics Account and open a new spreadsheet.
  2. Click on Get add-ons under Add-ons in the toolbar.
  3. In the Add-Ons Popup search for ‘Google Analytics’ using the search box in the top right corner and click on the blue +free button to connect with Google Analytics.
  4. Accept the permission request form Google Analytics to continue.




Create a new Google Analytics Report


1) In your Google Drive Account, open a new Spreadsheet.


2) In the toolbar under Add-Ons, chose Google Analytics and click on Create new report and accept the upgrade notice that appears.


3) To create a new report:


a) Assign a name to your report.


b) Define the Google Analytics account, property and view.


c) Select the metrics and dimensions by clicking in the field and choosing a value from the dropdown menu or by typing the name of the value in the field


d) Click on create Report.


4. The following configuration options are available, please specify them based on your requirements:


– Report Name

– Type

– View (Profile) ID / ids

– Start Date

– End Date

– Last N Days

– Metrics

– Dimensions

– Sort

– Filters

– Segment

– Sampling Level

– Start Index

– Max Results

– Spreadsheet URL


5. Click on Run Reports under Add-ons – Google Analytics to execute the Report.


Note: Reports will be saved in a new tab if you haven’t specified any other spreadsheet URL in the configuration options.


For more detailed instructions on how to install and use the Google Analytics add-on please see:



Schedule an automated Google Analytics Report


If you wish to run this report on a scheduled basis you can use the Report Scheduler in Google Drive.


  1. In your Google Analytics Report, click on Add-ons > Google Analytics > Schedule reports.



  1. In the Schedule Reports popup, tick the check box next to Enable reports to run automatically.
  2. Define how often and at what time the report should be scheduled.



  1. Click on Save. Now your report should run at the selected interval and time.


Fetch Google Analytics Data into a Google Spreadsheet


Before you can upload the data into datapine you will need to bring it into a valid table format with defined headers and rows.


  1. You can use the Import range formula to transfer the data from your Google Analytics report into another Google Spreadsheet.

IMPORTRANGE(“”, “sheet1!A1:C10”)


When using this formula for the first time, you will be asked to allow the connection of these two Google Spreadsheets.


Note: When importing data from different spreadsheets make sure the results generated in the reports are all in the same format otherwise you will get incorrect results when trying to connect them in one spreadsheet.


  1. Connect your Google Spreadsheet to datapine. For detailed instructions please see how to connect a csv file via URL.