Google Analytics
Laporan dengan nama dimension dan metric biasa, realtime, laporan pivot dan batch, metadata dan kompatibilitas, akun, property dan data stream (OAuth atau service account)
Beta v0.1.0 Node.js 11 aksi
Tentang
Plugin Graphrt untuk Google Analytics 4. Laporan lewat Data API v1beta serta pencarian akun, property dan data stream lewat Admin API v1beta. Plugin ini hanya membaca. Property Universal Analytics tidak didukung (Google sudah menghentikannya).
Yang bisa dilakukan
- run_report: dimensions × metrics over up to 4 date ranges, with dimension and metric filters, sorting, limit/offset (up to 250,000 rows, rowCount gives the total), totals (metric_aggregations), comparisons, cohorts and currency
- run_realtime_report: the last 30 minutes (60 for Analytics 360), up to 2 minute ranges
- run_pivot_report: pivot tables
- batch_run_reports: up to 5 reports in one call (each item uses the API's field names: dateRanges, orderBys, ...)
- get_metadata: every dimension and metric of a property, including custom ones (property_id: "0" for the common ones only)
- check_compatibility: which dimensions and metrics can be combined
- list_account_summaries, list_properties, get_property, list_data_streams: find property ids, time zones, currencies and measurement ids (Admin API)
- api_request: any other Data API endpoint (GET only for agents)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Run report
google-analytics.run_report - Realtime report
google-analytics.run_realtime_report - Pivot report
google-analytics.run_pivot_report - Batch reports
google-analytics.batch_run_reports - Dimensions and metrics
google-analytics.get_metadata - Check compatibility
google-analytics.check_compatibility - Accounts and properties
google-analytics.list_account_summaries - List properties
google-analytics.list_properties - Get property
google-analytics.get_property - List data streams
google-analytics.list_data_streams
Tampilkan semua 11 aksi
- Google Analytics Data API request
google-analytics.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
GOOGLE_REFRESH_TOKENOAuth refresh trio (scope analytics.readonly) -
GOOGLE_SERVICE_ACCOUNT_JSONPath to a service account key file, add the service account's email as a Viewer of each property (Admin → Property access management) -
GOOGLE_ACCESS_TOKENA ready access token (used only when neither of the above is set) -
GOOGLE_CLIENT_ID -
GOOGLE_CLIENT_SECRET -
GOOGLE_ANALYTICS_TOOL_TOKEN_SOURCE
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Google Analytics.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install google-analytics workflow.yaml
- id: top_pages
type: google-analytics.run_report
property_id: "{{#start.property#}}"
dimensions: [pagePath]
metrics: [screenPageViews, activeUsers]
date_ranges: [{ startDate: 28daysAgo, endDate: yesterday }]
dimension_filter: { filter: { fieldName: country, stringFilter: { value: Indonesia } } }
order_bys: [{ metric: { metricName: screenPageViews }, desc: true }]
limit: 20
- id: now
type: google-analytics.run_realtime_report
property_id: "{{#start.property#}}"
metrics: [activeUsers]