Google Analytics Data API v1 Pivot Report Demo

Check out the GitHub repository to download the demo sources and see deployment instructions.

This application demonstrates how to build a pivot report using the runPivotReport method of the Google Analytics Data API v1 and visualize the result using JavaScript.

The API call builds a pivot report with country, language and browser pivots, displaying the number of sessions for the specified date range for each pivot column.

Click "Authorize" button to start the OAuth2 flow and run the query.

When running this demo using your own domain, make sure to edit the run_pivot_report.js file and replace the clientId variable with your OAuth2 client id.

Google Analytics 4 Property ID: