With Sheetgo, you can connect Google Analytics data directly to Google Sheets using a GET request to the Google Analytics API. This allows you to automatically retrieve website performance metrics such as sessions, users, pageviews, traffic sources, and campaign data into a structured spreadsheet. Instead of manually exporting reports from Google Analytics, Sheetgo retrieves the data automatically using OAuth 2.0 authentication and scheduled refreshes, ensuring your marketing reports stay continuously updated.
Prerequisites
A Google Analytics property (Universal Analytics endpoint supporting GET requests)
A Google Cloud Project
Google Cloud Console: https://console.cloud.google.com/
Google Analytics API documentation: https://developers.google.com/analytics
Google OAuth 2.0 documentation: https://developers.google.com/identity/protocols/oauth2
Enabled Google Analytics API in your Google Cloud project
OAuth 2.0 Client ID and Client Secret
A Refresh Token generated via OAuth consent flow
Your Google Analytics View ID (format: ga:XXXX)
A Sheetgo account using the same Google account connected to Google Analytics
Step 1: Identify the Required API Endpoint
To use a GET request, you must use a Google Analytics endpoint that supports query parameters directly in the URL. The Analytics Reporting API endpoint format is
https://www.googleapis.com/analytics/v3/data/ga
You must include required query parameters such as ids (formatted as ga:VIEW_ID), start-date, end-date, and metrics. Optional parameters include dimensions, filters, and max-results. Refer to the documentation linked in the Prerequisites to define your required metrics and dimensions.
Step 2: Generate API Credentials
Google Analytics uses OAuth 2.0 authentication. Log in to Google Cloud Console and enable the Google Analytics API. Navigate to APIs & Services → Credentials and create an OAuth 2.0 Client ID. Configure the OAuth consent screen if required. After creating the Client ID and Client Secret, complete the OAuth authorization flow described in the documentation linked in the Prerequisites to generate an Access Token and Refresh Token. Access tokens expire approximately every hour, so the Refresh Token is required to maintain long-term automation within Sheetgo.
Step 3: Open the Sheetgo API Connector
Log in to Sheetgo and open an existing workflow or create a new one. Click on Connect and choose API Request under Data Source. Then select HTTP Request as the method type. You’ll be prompted to enter the API URL and configure authentication and headers.
Step 4: Configure the API Request in Sheetgo
Log in to Sheetgo and create a new workflow. Select HTTP Request as your source and choose the GET method. Paste your full request URL into the Request URL field, such as
https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&start-date=30daysAgo&end-date=today&metrics=ga:sessions,ga:users&dimensions=ga:date
Replace the View ID with your actual value.
Then open the Headers section and insert the following JSON configuration:
{
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
"@auth": {
"auth_method": "oauth2",
"auth_type": "Bearer",
"refresh_url": "https://oauth2.googleapis.com/token",
"refresh_params": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"refresh_token": "YOUR_REFRESH_TOKEN",
"grant_type": "refresh_token"
}
},
"@pagination": {
"type": "page",
"page_param": "start-index",
"per_page_param": "max-results"
}
}Replace all placeholder values with your actual credentials. If the API response nests data under a rows field, you may define a data root using the @flags parameter with data_root set to rows.
Step 5: Choose the Destination Spreadsheet
After configuring the API request, click Next in Sheetgo. Choose Google Sheets as your destination. You may select an existing spreadsheet or create a new one. Sheetgo will automatically structure the JSON response into columns. If necessary, add a Filter by Condition processor before selecting the destination to refine the dataset. Confirm the sheet tab where the Google Analytics data will be stored.
Step 6: Execute the Sheetgo Connection
Click Finish and Save to activate the workflow. Run the connection to test the integration. Sheetgo will fetch data from Google Analytics and populate your Google Sheet. Configure scheduled refreshes to keep your analytics data updated automatically. Since OAuth refresh tokens are included in the header configuration, Sheetgo will automatically request new access tokens when required, ensuring continuous synchronization with Google Sheets.
