We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GA-3 is expiring next year. Oh shit.
The text was updated successfully, but these errors were encountered:
https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-cli
Sorry, something went wrong.
With gcloud command
gcloud
curl -X POST -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) -H "Content-Type: application/json; charset=utf-8" \ https://analyticsdata.googleapis.com/v1beta/properties/$GA4_PROPERTY_ID:runReport -d '{"dateRanges":[{"startDate":"2020-03-31","endDate":"today"}],"dimensions":[{"name":"city"}],"metrics":[{"name":"activeUsers"}]}
Without, probably won't go this route
# Obtain an access token using the key file curl -s -d "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$(JWT=$(cat /path/to/keyfile.json); echo -n $JWT | openssl base64 -A)" https://oauth2.googleapis.com/token # Use the access token to send your request using curl curl -X POST -H "Authorization: Bearer <ACCESS_TOKEN>" -H "Content-Type: application/json; charset=utf-8" \ https://analyticsdata.googleapis.com/v1beta/properties/$GA4_PROPERTY_ID:runReport -d '{"dateRanges":[{"startDate":"2020-03-31","endDate":"today"}],"dimensions":[{"name":"city"}],"metrics":[{"name":"activeUsers"}]}'
More notes
property_id="###" curl -X POST \ -H "Authorization: Bearer $jwt" \ -H "Content-Type: application/json; charset=utf-8" \ -d @body.json \ https://analyticsdata.googleapis.com/v1beta/properties/$property_id:runReport
basic endpoints
Organic ----- activeUsers newUsers sessionsPerUser avgSessionDuration screenPageViews screenPageViewsPerSession screenPageViewsPerUser organicGoogleSearchClicks organicGoogleSearchImpressions bounceRate Advertising ----- impressions adClicks adCost CPC CTR costPerConversion transactions transactionRevenue revenuePerTransaction revenuePerItem transactionsPerSession transactionsPerUser
fdiebel
No branches or pull requests
GA-3 is expiring next year. Oh shit.
The text was updated successfully, but these errors were encountered: