Class: Google::Apis::AnalyticsdataV1beta::AnalyticsDataService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::AnalyticsdataV1beta::AnalyticsDataService
- Defined in:
- lib/google/apis/analyticsdata_v1beta/service.rb
Overview
Google Analytics Data API
Accesses report data in Google Analytics.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#batch_property_run_pivot_reports(property, batch_run_pivot_reports_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::BatchRunPivotReportsResponse
Returns multiple pivot reports in a batch.
-
#batch_property_run_reports(property, batch_run_reports_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::BatchRunReportsResponse
Returns multiple reports in a batch.
-
#get_property_metadata(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::Metadata
Returns metadata for dimensions and metrics available in reporting methods.
-
#initialize ⇒ AnalyticsDataService
constructor
A new instance of AnalyticsDataService.
-
#run_property_pivot_report(property, run_pivot_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunPivotReportResponse
Returns a customized pivot report of your Google Analytics event data.
-
#run_property_realtime_report(property, run_realtime_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunRealtimeReportResponse
The Google Analytics Realtime API returns a customized report of realtime event data for your property.
-
#run_property_report(property, run_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunReportResponse
Returns a customized report of your Google Analytics event data.
Constructor Details
#initialize ⇒ AnalyticsDataService
Returns a new instance of AnalyticsDataService.
45 46 47 48 49 50 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 45 def initialize super('https://analyticsdata.googleapis.com/', '', client_name: 'google-apis-analyticsdata_v1beta', client_version: Google::Apis::AnalyticsdataV1beta::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
43 44 45 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#batch_property_run_pivot_reports(property, batch_run_pivot_reports_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::BatchRunPivotReportsResponse
Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 79 def batch_property_run_pivot_reports(property, batch_run_pivot_reports_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta/{+property}:batchRunPivotReports', ) command.request_representation = Google::Apis::AnalyticsdataV1beta::BatchRunPivotReportsRequest::Representation command.request_object = batch_run_pivot_reports_request_object command.response_representation = Google::Apis::AnalyticsdataV1beta::BatchRunPivotReportsResponse::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::BatchRunPivotReportsResponse command.params['property'] = property unless property.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_property_run_reports(property, batch_run_reports_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::BatchRunReportsResponse
Returns multiple reports in a batch. All reports must be for the same GA4 Property.
118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 118 def batch_property_run_reports(property, batch_run_reports_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta/{+property}:batchRunReports', ) command.request_representation = Google::Apis::AnalyticsdataV1beta::BatchRunReportsRequest::Representation command.request_object = batch_run_reports_request_object command.response_representation = Google::Apis::AnalyticsdataV1beta::BatchRunReportsResponse::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::BatchRunReportsResponse command.params['property'] = property unless property.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_property_metadata(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::Metadata
Returns metadata for dimensions and metrics available in reporting methods.
Used to explore the dimensions and metrics. In this method, a Google Analytics
GA4 Property Identifier is specified in the request, and the metadata response
includes Custom dimensions and metrics as well as Universal metadata. For
example if a custom metric with parameter name levels_unlocked is registered
to a property, the Metadata response will contain customEvent:levels_unlocked
. Universal metadata are dimensions and metrics applicable to any property
such as country and totalUsers.
163 164 165 166 167 168 169 170 171 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 163 def (name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta/{+name}', ) command.response_representation = Google::Apis::AnalyticsdataV1beta::Metadata::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::Metadata command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#run_property_pivot_report(property, run_pivot_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunPivotReportResponse
Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 202 def run_property_pivot_report(property, run_pivot_report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta/{+property}:runPivotReport', ) command.request_representation = Google::Apis::AnalyticsdataV1beta::RunPivotReportRequest::Representation command.request_object = run_pivot_report_request_object command.response_representation = Google::Apis::AnalyticsdataV1beta::RunPivotReportResponse::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::RunPivotReportResponse command.params['property'] = property unless property.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#run_property_realtime_report(property, run_realtime_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunRealtimeReportResponse
The Google Analytics Realtime API returns a customized report of realtime event data for your property. These reports show events and usage from the last 30 minutes.
240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 240 def run_property_realtime_report(property, run_realtime_report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta/{+property}:runRealtimeReport', ) command.request_representation = Google::Apis::AnalyticsdataV1beta::RunRealtimeReportRequest::Representation command.request_object = run_realtime_report_request_object command.response_representation = Google::Apis::AnalyticsdataV1beta::RunRealtimeReportResponse::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::RunRealtimeReportResponse command.params['property'] = property unless property.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#run_property_report(property, run_report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AnalyticsdataV1beta::RunReportResponse
Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.
284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/google/apis/analyticsdata_v1beta/service.rb', line 284 def run_property_report(property, run_report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta/{+property}:runReport', ) command.request_representation = Google::Apis::AnalyticsdataV1beta::RunReportRequest::Representation command.request_object = run_report_request_object command.response_representation = Google::Apis::AnalyticsdataV1beta::RunReportResponse::Representation command.response_class = Google::Apis::AnalyticsdataV1beta::RunReportResponse command.params['property'] = property unless property.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |