GA4 - Google Analytics 4 Data API Query GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more. Setup (one-time) 1. Enable Google Analytics Data API: https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com 2. Create OAuth credentials or use existing Google Cloud project 3. Set environment variables: - - Your GA4 property ID (numeric, e.g., "123456789") - - OAuth client ID - - OAuth client secret - - OAuth refresh token (from initial auth flow) Common Queries Top Pages (by pageviews) Top Pages with Sessions & Users Traffic Sour…