Class: Google::Apis::AnalyticsV2_4::AnalyticsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::AnalyticsV2_4::AnalyticsService
- Defined in:
- generated/google/apis/analytics_v2_4/service.rb
Overview
Google Analytics API
Views and manages your Google Analytics data.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
-
#user_ip ⇒ String
IP address of the site where the request originates.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#get_datum(ids, start_date, end_date, metrics, dimensions: nil, filters: nil, max_results: nil, segment: nil, sort: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Returns Analytics report data for a view (profile).
-
#initialize ⇒ AnalyticsService
constructor
A new instance of AnalyticsService.
-
#list_management_accounts(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Lists all accounts to which the user has access.
-
#list_management_goals(account_id, web_property_id, profile_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Lists goals to which the user has access.
-
#list_management_profiles(account_id, web_property_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Lists views (profiles) to which the user has access.
-
#list_management_segments(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Lists advanced segments to which the user has access.
-
#list_management_webproperties(account_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Lists web properties to which the user has access.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ AnalyticsService
Returns a new instance of AnalyticsService
51 52 53 54 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 51 def initialize super('https://www.googleapis.com/', 'analytics/v2.4/') @batch_path = 'batch/analytics/v2.4' 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 'generated/google/apis/analytics_v2_4/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. Overrides userIp if both are provided.
44 45 46 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 44 def quota_user @quota_user end |
#user_ip ⇒ String
Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.
49 50 51 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 49 def user_ip @user_ip end |
Instance Method Details
#get_datum(ids, start_date, end_date, metrics, dimensions: nil, filters: nil, max_results: nil, segment: nil, sort: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Returns Analytics report data for a view (profile).
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 105 def get_datum(ids, start_date, end_date, metrics, dimensions: nil, filters: nil, max_results: nil, segment: nil, sort: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'data', ) command.query['dimensions'] = dimensions unless dimensions.nil? command.query['end-date'] = end_date unless end_date.nil? command.query['filters'] = filters unless filters.nil? command.query['ids'] = ids unless ids.nil? command.query['max-results'] = max_results unless max_results.nil? command.query['metrics'] = metrics unless metrics.nil? command.query['segment'] = segment unless segment.nil? command.query['sort'] = sort unless sort.nil? command.query['start-date'] = start_date unless start_date.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_management_accounts(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Lists all accounts to which the user has access.
150 151 152 153 154 155 156 157 158 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 150 def list_management_accounts(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'management/accounts', ) command.query['max-results'] = max_results unless max_results.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_management_goals(account_id, web_property_id, profile_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Lists goals to which the user has access.
197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 197 def list_management_goals(account_id, web_property_id, profile_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals', ) command.params['accountId'] = account_id unless account_id.nil? command.params['webPropertyId'] = web_property_id unless web_property_id.nil? command.params['profileId'] = profile_id unless profile_id.nil? command.query['max-results'] = max_results unless max_results.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_management_profiles(account_id, web_property_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Lists views (profiles) to which the user has access.
245 246 247 248 249 250 251 252 253 254 255 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 245 def list_management_profiles(account_id, web_property_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'management/accounts/{accountId}/webproperties/{webPropertyId}/profiles', ) command.params['accountId'] = account_id unless account_id.nil? command.params['webPropertyId'] = web_property_id unless web_property_id.nil? command.query['max-results'] = max_results unless max_results.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_management_segments(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Lists advanced segments to which the user has access.
284 285 286 287 288 289 290 291 292 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 284 def list_management_segments(max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'management/segments', ) command.query['max-results'] = max_results unless max_results.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_management_webproperties(account_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Lists web properties to which the user has access.
324 325 326 327 328 329 330 331 332 333 |
# File 'generated/google/apis/analytics_v2_4/service.rb', line 324 def list_management_webproperties(account_id, max_results: nil, start_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'management/accounts/{accountId}/webproperties', ) command.params['accountId'] = account_id unless account_id.nil? command.query['max-results'] = max_results unless max_results.nil? command.query['start-index'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |