google-apis-analyticsreporting_v4 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-analyticsreporting_v4.rb +15 -0
- data/lib/google/apis/analyticsreporting_v4.rb +39 -0
- data/lib/google/apis/analyticsreporting_v4/classes.rb +2039 -0
- data/lib/google/apis/analyticsreporting_v4/gem_version.rb +28 -0
- data/lib/google/apis/analyticsreporting_v4/representations.rb +864 -0
- data/lib/google/apis/analyticsreporting_v4/service.rb +121 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dccc1362ab499453c64016bb78729425f4e582a19a6a3e2340cce427f6e695a2
|
4
|
+
data.tar.gz: 2f4ec3d65228040f67c30f5448e33e1d406e3615d95c2f3ba9832cd36470c89b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 14d2a08623097b76e59582b3fce9284e0f1efaa18eac5e82584c760e34ce3ca424e3a45e35dee9066581453878094f4ad838cb200bc793f544ffcb5d4a7e3e19
|
7
|
+
data.tar.gz: 5cd0ee74be35d8889a96e4bf4b9dfdf9c46e5f4d5cb462b18ccf45001c745964ca09705ee4f4ff35356519532f0dd076bb291dafa048cc9c00533c166b206da0
|
data/.yardopts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
--hide-void-return
|
2
|
+
--no-private
|
3
|
+
--verbose
|
4
|
+
--title=google-apis-analyticsreporting_v4
|
5
|
+
--markup-provider=redcarpet
|
6
|
+
--markup=markdown
|
7
|
+
--main OVERVIEW.md
|
8
|
+
lib/google/apis/analyticsreporting_v4/*.rb
|
9
|
+
lib/google/apis/analyticsreporting_v4.rb
|
10
|
+
-
|
11
|
+
OVERVIEW.md
|
12
|
+
CHANGELOG.md
|
13
|
+
LICENSE.md
|
data/CHANGELOG.md
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/OVERVIEW.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# Simple REST client for version V4 of the Analytics Reporting API
|
2
|
+
|
3
|
+
This is a simple client library for version V4 of the Analytics Reporting API. It provides:
|
4
|
+
|
5
|
+
* A client object that connects to the HTTP/JSON REST endpoint for the service.
|
6
|
+
* Ruby objects for data structures related to the service.
|
7
|
+
* Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
|
8
|
+
* Control of retry, pagination, and timeouts.
|
9
|
+
|
10
|
+
Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
|
11
|
+
|
12
|
+
## Getting started
|
13
|
+
|
14
|
+
### Before you begin
|
15
|
+
|
16
|
+
There are a few setup steps you need to complete before you can use this library:
|
17
|
+
|
18
|
+
1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
|
19
|
+
2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
|
20
|
+
3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/analyticsreporting.googleapis.com) in the console.
|
21
|
+
|
22
|
+
### Installation
|
23
|
+
|
24
|
+
Add this line to your application's Gemfile:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem 'google-apis-analyticsreporting_v4', '~> 0.1'
|
28
|
+
```
|
29
|
+
|
30
|
+
And then execute:
|
31
|
+
|
32
|
+
```
|
33
|
+
$ bundle
|
34
|
+
```
|
35
|
+
|
36
|
+
Or install it yourself as:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ gem install google-apis-analyticsreporting_v4
|
40
|
+
```
|
41
|
+
|
42
|
+
### Creating a client object
|
43
|
+
|
44
|
+
Once the gem is installed, you can load the client code and instantiate a client.
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# Load the client
|
48
|
+
require "google/apis/analyticsreporting_v4"
|
49
|
+
|
50
|
+
# Create a client object
|
51
|
+
client = Google::Apis::AnalyticsreportingV4::AnalyticsReportingService.new
|
52
|
+
|
53
|
+
# Authenticate calls
|
54
|
+
client.authentication = # ... use the googleauth gem to create credentials
|
55
|
+
```
|
56
|
+
|
57
|
+
See the class reference docs for information on the methods you can call from a client.
|
58
|
+
|
59
|
+
## Documentation
|
60
|
+
|
61
|
+
More detailed descriptions of the Google simple REST clients are available in two documents.
|
62
|
+
|
63
|
+
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
|
64
|
+
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
|
65
|
+
|
66
|
+
(Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Analyticsreporting service in particular.)
|
67
|
+
|
68
|
+
For reference information on specific calls in the Analytics Reporting API, see the {Google::Apis::AnalyticsreportingV4::AnalyticsReportingService class reference docs}.
|
69
|
+
|
70
|
+
## Which client should I use?
|
71
|
+
|
72
|
+
Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
|
73
|
+
|
74
|
+
This library, `google-apis-analyticsreporting_v4`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
|
75
|
+
|
76
|
+
Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
|
77
|
+
|
78
|
+
Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
|
79
|
+
|
80
|
+
**For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
|
81
|
+
|
82
|
+
The [product documentation](https://developers.google.com/analytics/devguides/reporting/core/v4/) may provide guidance regarding the preferred client library to use.
|
83
|
+
|
84
|
+
## Supported Ruby versions
|
85
|
+
|
86
|
+
This library is supported on Ruby 2.5+.
|
87
|
+
|
88
|
+
Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
|
89
|
+
|
90
|
+
## License
|
91
|
+
|
92
|
+
This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
|
93
|
+
|
94
|
+
## Support
|
95
|
+
|
96
|
+
Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "google/apis/analyticsreporting_v4"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/analyticsreporting_v4/service.rb'
|
16
|
+
require 'google/apis/analyticsreporting_v4/classes.rb'
|
17
|
+
require 'google/apis/analyticsreporting_v4/representations.rb'
|
18
|
+
require 'google/apis/analyticsreporting_v4/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# Analytics Reporting API
|
23
|
+
#
|
24
|
+
# Accesses Analytics report data.
|
25
|
+
#
|
26
|
+
# @see https://developers.google.com/analytics/devguides/reporting/core/v4/
|
27
|
+
module AnalyticsreportingV4
|
28
|
+
# Version of the Analytics Reporting API this client connects to.
|
29
|
+
# This is NOT the gem version.
|
30
|
+
VERSION = 'V4'
|
31
|
+
|
32
|
+
# View and manage your Google Analytics data
|
33
|
+
AUTH_ANALYTICS = 'https://www.googleapis.com/auth/analytics'
|
34
|
+
|
35
|
+
# See and download your Google Analytics data
|
36
|
+
AUTH_ANALYTICS_READONLY = 'https://www.googleapis.com/auth/analytics.readonly'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,2039 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module AnalyticsreportingV4
|
24
|
+
|
25
|
+
# An Activity represents data for an activity of a user. Note that an Activity
|
26
|
+
# is different from a hit. A hit might result in multiple Activity's. For
|
27
|
+
# example, if a hit includes a transaction and a goal completion, there will be
|
28
|
+
# two Activity protos for this hit, one for ECOMMERCE and one for GOAL.
|
29
|
+
# Conversely, multiple hits can also construct one Activity. In classic e-
|
30
|
+
# commerce, data for one transaction might be sent through multiple hits. These
|
31
|
+
# hits will be merged into one ECOMMERCE Activity.
|
32
|
+
class Activity
|
33
|
+
include Google::Apis::Core::Hashable
|
34
|
+
|
35
|
+
# Timestamp of the activity. If activities for a visit cross midnight and occur
|
36
|
+
# in two separate dates, then two sessions (one per date) share the session
|
37
|
+
# identifier. For example, say session ID 113472 has activity within 2019-08-20,
|
38
|
+
# and session ID 243742 has activity within 2019-08-25 and 2019-08-26. Session
|
39
|
+
# ID 113472 is one session, and session ID 243742 is two sessions.
|
40
|
+
# Corresponds to the JSON property `activityTime`
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :activity_time
|
43
|
+
|
44
|
+
# Type of this activity.
|
45
|
+
# Corresponds to the JSON property `activityType`
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :activity_type
|
48
|
+
|
49
|
+
# This will be set if `activity_type` equals `SCREEN_VIEW`.
|
50
|
+
# Corresponds to the JSON property `appview`
|
51
|
+
# @return [Google::Apis::AnalyticsreportingV4::ScreenviewData]
|
52
|
+
attr_accessor :appview
|
53
|
+
|
54
|
+
# For manual campaign tracking, it is the value of the utm_campaign campaign
|
55
|
+
# tracking parameter. For AdWords autotagging, it is the name(s) of the online
|
56
|
+
# ad campaign(s) you use for the property. If you use neither, its value is (not
|
57
|
+
# set).
|
58
|
+
# Corresponds to the JSON property `campaign`
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :campaign
|
61
|
+
|
62
|
+
# The Channel Group associated with an end user's session for this View (defined
|
63
|
+
# by the View's Channel Groupings).
|
64
|
+
# Corresponds to the JSON property `channelGrouping`
|
65
|
+
# @return [String]
|
66
|
+
attr_accessor :channel_grouping
|
67
|
+
|
68
|
+
# A list of all custom dimensions associated with this activity.
|
69
|
+
# Corresponds to the JSON property `customDimension`
|
70
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::CustomDimension>]
|
71
|
+
attr_accessor :custom_dimension
|
72
|
+
|
73
|
+
# E-commerce details associated with the user activity.
|
74
|
+
# Corresponds to the JSON property `ecommerce`
|
75
|
+
# @return [Google::Apis::AnalyticsreportingV4::EcommerceData]
|
76
|
+
attr_accessor :ecommerce
|
77
|
+
|
78
|
+
# Represents all the details pertaining to an event.
|
79
|
+
# Corresponds to the JSON property `event`
|
80
|
+
# @return [Google::Apis::AnalyticsreportingV4::EventData]
|
81
|
+
attr_accessor :event
|
82
|
+
|
83
|
+
# Represents a set of goals that were reached in an activity.
|
84
|
+
# Corresponds to the JSON property `goals`
|
85
|
+
# @return [Google::Apis::AnalyticsreportingV4::GoalSetData]
|
86
|
+
attr_accessor :goals
|
87
|
+
|
88
|
+
# The hostname from which the tracking request was made.
|
89
|
+
# Corresponds to the JSON property `hostname`
|
90
|
+
# @return [String]
|
91
|
+
attr_accessor :hostname
|
92
|
+
|
93
|
+
# For manual campaign tracking, it is the value of the utm_term campaign
|
94
|
+
# tracking parameter. For AdWords traffic, it contains the best matching
|
95
|
+
# targeting criteria. For the display network, where multiple targeting criteria
|
96
|
+
# could have caused the ad to show up, it returns the best matching targeting
|
97
|
+
# criteria as selected by Ads. This could be display_keyword, site placement,
|
98
|
+
# boomuserlist, user_interest, age, or gender. Otherwise its value is (not set).
|
99
|
+
# Corresponds to the JSON property `keyword`
|
100
|
+
# @return [String]
|
101
|
+
attr_accessor :keyword
|
102
|
+
|
103
|
+
# The first page in users' sessions, or the landing page.
|
104
|
+
# Corresponds to the JSON property `landingPagePath`
|
105
|
+
# @return [String]
|
106
|
+
attr_accessor :landing_page_path
|
107
|
+
|
108
|
+
# The type of referrals. For manual campaign tracking, it is the value of the
|
109
|
+
# utm_medium campaign tracking parameter. For AdWords autotagging, it is cpc. If
|
110
|
+
# users came from a search engine detected by Google Analytics, it is organic.
|
111
|
+
# If the referrer is not a search engine, it is referral. If users came directly
|
112
|
+
# to the property and document.referrer is empty, its value is (none).
|
113
|
+
# Corresponds to the JSON property `medium`
|
114
|
+
# @return [String]
|
115
|
+
attr_accessor :medium
|
116
|
+
|
117
|
+
# Represents details collected when the visitor views a page.
|
118
|
+
# Corresponds to the JSON property `pageview`
|
119
|
+
# @return [Google::Apis::AnalyticsreportingV4::PageviewData]
|
120
|
+
attr_accessor :pageview
|
121
|
+
|
122
|
+
# The source of referrals. For manual campaign tracking, it is the value of the
|
123
|
+
# utm_source campaign tracking parameter. For AdWords autotagging, it is google.
|
124
|
+
# If you use neither, it is the domain of the source (e.g., document.referrer)
|
125
|
+
# referring the users. It may also contain a port address. If users arrived
|
126
|
+
# without a referrer, its value is (direct).
|
127
|
+
# Corresponds to the JSON property `source`
|
128
|
+
# @return [String]
|
129
|
+
attr_accessor :source
|
130
|
+
|
131
|
+
def initialize(**args)
|
132
|
+
update!(**args)
|
133
|
+
end
|
134
|
+
|
135
|
+
# Update properties of this object
|
136
|
+
def update!(**args)
|
137
|
+
@activity_time = args[:activity_time] if args.key?(:activity_time)
|
138
|
+
@activity_type = args[:activity_type] if args.key?(:activity_type)
|
139
|
+
@appview = args[:appview] if args.key?(:appview)
|
140
|
+
@campaign = args[:campaign] if args.key?(:campaign)
|
141
|
+
@channel_grouping = args[:channel_grouping] if args.key?(:channel_grouping)
|
142
|
+
@custom_dimension = args[:custom_dimension] if args.key?(:custom_dimension)
|
143
|
+
@ecommerce = args[:ecommerce] if args.key?(:ecommerce)
|
144
|
+
@event = args[:event] if args.key?(:event)
|
145
|
+
@goals = args[:goals] if args.key?(:goals)
|
146
|
+
@hostname = args[:hostname] if args.key?(:hostname)
|
147
|
+
@keyword = args[:keyword] if args.key?(:keyword)
|
148
|
+
@landing_page_path = args[:landing_page_path] if args.key?(:landing_page_path)
|
149
|
+
@medium = args[:medium] if args.key?(:medium)
|
150
|
+
@pageview = args[:pageview] if args.key?(:pageview)
|
151
|
+
@source = args[:source] if args.key?(:source)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Defines a cohort. A cohort is a group of users who share a common
|
156
|
+
# characteristic. For example, all users with the same acquisition date belong
|
157
|
+
# to the same cohort.
|
158
|
+
class Cohort
|
159
|
+
include Google::Apis::Core::Hashable
|
160
|
+
|
161
|
+
# A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The
|
162
|
+
# start and end dates are specified in [ISO8601](https://en.wikipedia.org/wiki/
|
163
|
+
# ISO_8601) date format `YYYY-MM-DD`.
|
164
|
+
# Corresponds to the JSON property `dateRange`
|
165
|
+
# @return [Google::Apis::AnalyticsreportingV4::DateRange]
|
166
|
+
attr_accessor :date_range
|
167
|
+
|
168
|
+
# A unique name for the cohort. If not defined name will be auto-generated with
|
169
|
+
# values cohort_[1234...].
|
170
|
+
# Corresponds to the JSON property `name`
|
171
|
+
# @return [String]
|
172
|
+
attr_accessor :name
|
173
|
+
|
174
|
+
# Type of the cohort. The only supported type as of now is `FIRST_VISIT_DATE`.
|
175
|
+
# If this field is unspecified the cohort is treated as `FIRST_VISIT_DATE` type
|
176
|
+
# cohort.
|
177
|
+
# Corresponds to the JSON property `type`
|
178
|
+
# @return [String]
|
179
|
+
attr_accessor :type
|
180
|
+
|
181
|
+
def initialize(**args)
|
182
|
+
update!(**args)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Update properties of this object
|
186
|
+
def update!(**args)
|
187
|
+
@date_range = args[:date_range] if args.key?(:date_range)
|
188
|
+
@name = args[:name] if args.key?(:name)
|
189
|
+
@type = args[:type] if args.key?(:type)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Defines a cohort group. For example: "cohortGroup": ` "cohorts": [` "name": "
|
194
|
+
# cohort 1", "type": "FIRST_VISIT_DATE", "dateRange": ` "startDate": "2015-08-01"
|
195
|
+
# , "endDate": "2015-08-01" ` `,` "name": "cohort 2" "type": "FIRST_VISIT_DATE" "
|
196
|
+
# dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" ` `] `
|
197
|
+
class CohortGroup
|
198
|
+
include Google::Apis::Core::Hashable
|
199
|
+
|
200
|
+
# The definition for the cohort.
|
201
|
+
# Corresponds to the JSON property `cohorts`
|
202
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Cohort>]
|
203
|
+
attr_accessor :cohorts
|
204
|
+
|
205
|
+
# Enable Life Time Value (LTV). LTV measures lifetime value for users acquired
|
206
|
+
# through different channels. Please see: [Cohort Analysis](https://support.
|
207
|
+
# google.com/analytics/answer/6074676) and [Lifetime Value](https://support.
|
208
|
+
# google.com/analytics/answer/6182550) If the value of lifetimeValue is false: -
|
209
|
+
# The metric values are similar to the values in the web interface cohort report.
|
210
|
+
# - The cohort definition date ranges must be aligned to the calendar week and
|
211
|
+
# month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in the cohort
|
212
|
+
# definition should be a Sunday and the `endDate` should be the following
|
213
|
+
# Saturday, and for `ga:cohortNthMonth`, the `startDate` should be the 1st of
|
214
|
+
# the month and `endDate` should be the last day of the month. When the
|
215
|
+
# lifetimeValue is true: - The metric values will correspond to the values in
|
216
|
+
# the web interface LifeTime value report. - The Lifetime Value report shows you
|
217
|
+
# how user value (Revenue) and engagement (Appviews, Goal Completions, Sessions,
|
218
|
+
# and Session Duration) grow during the 90 days after a user is acquired. - The
|
219
|
+
# metrics are calculated as a cumulative average per user per the time increment.
|
220
|
+
# - The cohort definition date ranges need not be aligned to the calendar week
|
221
|
+
# and month boundaries. - The `viewId` must be an [app view ID](https://support.
|
222
|
+
# google.com/analytics/answer/2649553#WebVersusAppViews)
|
223
|
+
# Corresponds to the JSON property `lifetimeValue`
|
224
|
+
# @return [Boolean]
|
225
|
+
attr_accessor :lifetime_value
|
226
|
+
alias_method :lifetime_value?, :lifetime_value
|
227
|
+
|
228
|
+
def initialize(**args)
|
229
|
+
update!(**args)
|
230
|
+
end
|
231
|
+
|
232
|
+
# Update properties of this object
|
233
|
+
def update!(**args)
|
234
|
+
@cohorts = args[:cohorts] if args.key?(:cohorts)
|
235
|
+
@lifetime_value = args[:lifetime_value] if args.key?(:lifetime_value)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
# Column headers.
|
240
|
+
class ColumnHeader
|
241
|
+
include Google::Apis::Core::Hashable
|
242
|
+
|
243
|
+
# The dimension names in the response.
|
244
|
+
# Corresponds to the JSON property `dimensions`
|
245
|
+
# @return [Array<String>]
|
246
|
+
attr_accessor :dimensions
|
247
|
+
|
248
|
+
# The headers for the metrics.
|
249
|
+
# Corresponds to the JSON property `metricHeader`
|
250
|
+
# @return [Google::Apis::AnalyticsreportingV4::MetricHeader]
|
251
|
+
attr_accessor :metric_header
|
252
|
+
|
253
|
+
def initialize(**args)
|
254
|
+
update!(**args)
|
255
|
+
end
|
256
|
+
|
257
|
+
# Update properties of this object
|
258
|
+
def update!(**args)
|
259
|
+
@dimensions = args[:dimensions] if args.key?(:dimensions)
|
260
|
+
@metric_header = args[:metric_header] if args.key?(:metric_header)
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
# Custom dimension.
|
265
|
+
class CustomDimension
|
266
|
+
include Google::Apis::Core::Hashable
|
267
|
+
|
268
|
+
# Slot number of custom dimension.
|
269
|
+
# Corresponds to the JSON property `index`
|
270
|
+
# @return [Fixnum]
|
271
|
+
attr_accessor :index
|
272
|
+
|
273
|
+
# Value of the custom dimension. Default value (i.e. empty string) indicates
|
274
|
+
# clearing sesion/visitor scope custom dimension value.
|
275
|
+
# Corresponds to the JSON property `value`
|
276
|
+
# @return [String]
|
277
|
+
attr_accessor :value
|
278
|
+
|
279
|
+
def initialize(**args)
|
280
|
+
update!(**args)
|
281
|
+
end
|
282
|
+
|
283
|
+
# Update properties of this object
|
284
|
+
def update!(**args)
|
285
|
+
@index = args[:index] if args.key?(:index)
|
286
|
+
@value = args[:value] if args.key?(:value)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
# A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The
|
291
|
+
# start and end dates are specified in [ISO8601](https://en.wikipedia.org/wiki/
|
292
|
+
# ISO_8601) date format `YYYY-MM-DD`.
|
293
|
+
class DateRange
|
294
|
+
include Google::Apis::Core::Hashable
|
295
|
+
|
296
|
+
# The end date for the query in the format `YYYY-MM-DD`.
|
297
|
+
# Corresponds to the JSON property `endDate`
|
298
|
+
# @return [String]
|
299
|
+
attr_accessor :end_date
|
300
|
+
|
301
|
+
# The start date for the query in the format `YYYY-MM-DD`.
|
302
|
+
# Corresponds to the JSON property `startDate`
|
303
|
+
# @return [String]
|
304
|
+
attr_accessor :start_date
|
305
|
+
|
306
|
+
def initialize(**args)
|
307
|
+
update!(**args)
|
308
|
+
end
|
309
|
+
|
310
|
+
# Update properties of this object
|
311
|
+
def update!(**args)
|
312
|
+
@end_date = args[:end_date] if args.key?(:end_date)
|
313
|
+
@start_date = args[:start_date] if args.key?(:start_date)
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
# Used to return a list of metrics for a single DateRange / dimension
|
318
|
+
# combination
|
319
|
+
class DateRangeValues
|
320
|
+
include Google::Apis::Core::Hashable
|
321
|
+
|
322
|
+
# The values of each pivot region.
|
323
|
+
# Corresponds to the JSON property `pivotValueRegions`
|
324
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::PivotValueRegion>]
|
325
|
+
attr_accessor :pivot_value_regions
|
326
|
+
|
327
|
+
# Each value corresponds to each Metric in the request.
|
328
|
+
# Corresponds to the JSON property `values`
|
329
|
+
# @return [Array<String>]
|
330
|
+
attr_accessor :values
|
331
|
+
|
332
|
+
def initialize(**args)
|
333
|
+
update!(**args)
|
334
|
+
end
|
335
|
+
|
336
|
+
# Update properties of this object
|
337
|
+
def update!(**args)
|
338
|
+
@pivot_value_regions = args[:pivot_value_regions] if args.key?(:pivot_value_regions)
|
339
|
+
@values = args[:values] if args.key?(:values)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
# [Dimensions](https://support.google.com/analytics/answer/1033861) are
|
344
|
+
# attributes of your data. For example, the dimension `ga:city` indicates the
|
345
|
+
# city, for example, "Paris" or "New York", from which a session originates.
|
346
|
+
class Dimension
|
347
|
+
include Google::Apis::Core::Hashable
|
348
|
+
|
349
|
+
# If non-empty, we place dimension values into buckets after string to int64.
|
350
|
+
# Dimension values that are not the string representation of an integral value
|
351
|
+
# will be converted to zero. The bucket values have to be in increasing order.
|
352
|
+
# Each bucket is closed on the lower end, and open on the upper end. The "first"
|
353
|
+
# bucket includes all values less than the first boundary, the "last" bucket
|
354
|
+
# includes all values up to infinity. Dimension values that fall in a bucket get
|
355
|
+
# transformed to a new dimension value. For example, if one gives a list of "0,
|
356
|
+
# 1, 3, 4, 7", then we return the following buckets: - bucket #1: values < 0,
|
357
|
+
# dimension value "<0" - bucket #2: values in [0,1), dimension value "0" -
|
358
|
+
# bucket #3: values in [1,3), dimension value "1-2" - bucket #4: values in [3,4),
|
359
|
+
# dimension value "3" - bucket #5: values in [4,7), dimension value "4-6" -
|
360
|
+
# bucket #6: values >= 7, dimension value "7+" NOTE: If you are applying
|
361
|
+
# histogram mutation on any dimension, and using that dimension in sort, you
|
362
|
+
# will want to use the sort type `HISTOGRAM_BUCKET` for that purpose. Without
|
363
|
+
# that the dimension values will be sorted according to dictionary (
|
364
|
+
# lexicographic) order. For example the ascending dictionary order is: "<50", "
|
365
|
+
# 1001+", "121-1000", "50-120" And the ascending `HISTOGRAM_BUCKET` order is: "<
|
366
|
+
# 50", "50-120", "121-1000", "1001+" The client has to explicitly request `"
|
367
|
+
# orderType": "HISTOGRAM_BUCKET"` for a histogram-mutated dimension.
|
368
|
+
# Corresponds to the JSON property `histogramBuckets`
|
369
|
+
# @return [Array<Fixnum>]
|
370
|
+
attr_accessor :histogram_buckets
|
371
|
+
|
372
|
+
# Name of the dimension to fetch, for example `ga:browser`.
|
373
|
+
# Corresponds to the JSON property `name`
|
374
|
+
# @return [String]
|
375
|
+
attr_accessor :name
|
376
|
+
|
377
|
+
def initialize(**args)
|
378
|
+
update!(**args)
|
379
|
+
end
|
380
|
+
|
381
|
+
# Update properties of this object
|
382
|
+
def update!(**args)
|
383
|
+
@histogram_buckets = args[:histogram_buckets] if args.key?(:histogram_buckets)
|
384
|
+
@name = args[:name] if args.key?(:name)
|
385
|
+
end
|
386
|
+
end
|
387
|
+
|
388
|
+
# Dimension filter specifies the filtering options on a dimension.
|
389
|
+
class DimensionFilter
|
390
|
+
include Google::Apis::Core::Hashable
|
391
|
+
|
392
|
+
# Should the match be case sensitive? Default is false.
|
393
|
+
# Corresponds to the JSON property `caseSensitive`
|
394
|
+
# @return [Boolean]
|
395
|
+
attr_accessor :case_sensitive
|
396
|
+
alias_method :case_sensitive?, :case_sensitive
|
397
|
+
|
398
|
+
# The dimension to filter on. A DimensionFilter must contain a dimension.
|
399
|
+
# Corresponds to the JSON property `dimensionName`
|
400
|
+
# @return [String]
|
401
|
+
attr_accessor :dimension_name
|
402
|
+
|
403
|
+
# Strings or regular expression to match against. Only the first value of the
|
404
|
+
# list is used for comparison unless the operator is `IN_LIST`. If `IN_LIST`
|
405
|
+
# operator, then the entire list is used to filter the dimensions as explained
|
406
|
+
# in the description of the `IN_LIST` operator.
|
407
|
+
# Corresponds to the JSON property `expressions`
|
408
|
+
# @return [Array<String>]
|
409
|
+
attr_accessor :expressions
|
410
|
+
|
411
|
+
# Logical `NOT` operator. If this boolean is set to true, then the matching
|
412
|
+
# dimension values will be excluded in the report. The default is false.
|
413
|
+
# Corresponds to the JSON property `not`
|
414
|
+
# @return [Boolean]
|
415
|
+
attr_accessor :not
|
416
|
+
alias_method :not?, :not
|
417
|
+
|
418
|
+
# How to match the dimension to the expression. The default is REGEXP.
|
419
|
+
# Corresponds to the JSON property `operator`
|
420
|
+
# @return [String]
|
421
|
+
attr_accessor :operator
|
422
|
+
|
423
|
+
def initialize(**args)
|
424
|
+
update!(**args)
|
425
|
+
end
|
426
|
+
|
427
|
+
# Update properties of this object
|
428
|
+
def update!(**args)
|
429
|
+
@case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
|
430
|
+
@dimension_name = args[:dimension_name] if args.key?(:dimension_name)
|
431
|
+
@expressions = args[:expressions] if args.key?(:expressions)
|
432
|
+
@not = args[:not] if args.key?(:not)
|
433
|
+
@operator = args[:operator] if args.key?(:operator)
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
# A group of dimension filters. Set the operator value to specify how the
|
438
|
+
# filters are logically combined.
|
439
|
+
class DimensionFilterClause
|
440
|
+
include Google::Apis::Core::Hashable
|
441
|
+
|
442
|
+
# The repeated set of filters. They are logically combined based on the operator
|
443
|
+
# specified.
|
444
|
+
# Corresponds to the JSON property `filters`
|
445
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilter>]
|
446
|
+
attr_accessor :filters
|
447
|
+
|
448
|
+
# The operator for combining multiple dimension filters. If unspecified, it is
|
449
|
+
# treated as an `OR`.
|
450
|
+
# Corresponds to the JSON property `operator`
|
451
|
+
# @return [String]
|
452
|
+
attr_accessor :operator
|
453
|
+
|
454
|
+
def initialize(**args)
|
455
|
+
update!(**args)
|
456
|
+
end
|
457
|
+
|
458
|
+
# Update properties of this object
|
459
|
+
def update!(**args)
|
460
|
+
@filters = args[:filters] if args.key?(:filters)
|
461
|
+
@operator = args[:operator] if args.key?(:operator)
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
# Dynamic segment definition for defining the segment within the request. A
|
466
|
+
# segment can select users, sessions or both.
|
467
|
+
class DynamicSegment
|
468
|
+
include Google::Apis::Core::Hashable
|
469
|
+
|
470
|
+
# The name of the dynamic segment.
|
471
|
+
# Corresponds to the JSON property `name`
|
472
|
+
# @return [String]
|
473
|
+
attr_accessor :name
|
474
|
+
|
475
|
+
# SegmentDefinition defines the segment to be a set of SegmentFilters which are
|
476
|
+
# combined together with a logical `AND` operation.
|
477
|
+
# Corresponds to the JSON property `sessionSegment`
|
478
|
+
# @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
|
479
|
+
attr_accessor :session_segment
|
480
|
+
|
481
|
+
# SegmentDefinition defines the segment to be a set of SegmentFilters which are
|
482
|
+
# combined together with a logical `AND` operation.
|
483
|
+
# Corresponds to the JSON property `userSegment`
|
484
|
+
# @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
|
485
|
+
attr_accessor :user_segment
|
486
|
+
|
487
|
+
def initialize(**args)
|
488
|
+
update!(**args)
|
489
|
+
end
|
490
|
+
|
491
|
+
# Update properties of this object
|
492
|
+
def update!(**args)
|
493
|
+
@name = args[:name] if args.key?(:name)
|
494
|
+
@session_segment = args[:session_segment] if args.key?(:session_segment)
|
495
|
+
@user_segment = args[:user_segment] if args.key?(:user_segment)
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
# E-commerce details associated with the user activity.
|
500
|
+
class EcommerceData
|
501
|
+
include Google::Apis::Core::Hashable
|
502
|
+
|
503
|
+
# Action associated with this e-commerce action.
|
504
|
+
# Corresponds to the JSON property `actionType`
|
505
|
+
# @return [String]
|
506
|
+
attr_accessor :action_type
|
507
|
+
|
508
|
+
# The type of this e-commerce activity.
|
509
|
+
# Corresponds to the JSON property `ecommerceType`
|
510
|
+
# @return [String]
|
511
|
+
attr_accessor :ecommerce_type
|
512
|
+
|
513
|
+
# Details of the products in this transaction.
|
514
|
+
# Corresponds to the JSON property `products`
|
515
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::ProductData>]
|
516
|
+
attr_accessor :products
|
517
|
+
|
518
|
+
# Represents details collected when the visitor performs a transaction on the
|
519
|
+
# page.
|
520
|
+
# Corresponds to the JSON property `transaction`
|
521
|
+
# @return [Google::Apis::AnalyticsreportingV4::TransactionData]
|
522
|
+
attr_accessor :transaction
|
523
|
+
|
524
|
+
def initialize(**args)
|
525
|
+
update!(**args)
|
526
|
+
end
|
527
|
+
|
528
|
+
# Update properties of this object
|
529
|
+
def update!(**args)
|
530
|
+
@action_type = args[:action_type] if args.key?(:action_type)
|
531
|
+
@ecommerce_type = args[:ecommerce_type] if args.key?(:ecommerce_type)
|
532
|
+
@products = args[:products] if args.key?(:products)
|
533
|
+
@transaction = args[:transaction] if args.key?(:transaction)
|
534
|
+
end
|
535
|
+
end
|
536
|
+
|
537
|
+
# Represents all the details pertaining to an event.
|
538
|
+
class EventData
|
539
|
+
include Google::Apis::Core::Hashable
|
540
|
+
|
541
|
+
# Type of interaction with the object. Eg: 'play'.
|
542
|
+
# Corresponds to the JSON property `eventAction`
|
543
|
+
# @return [String]
|
544
|
+
attr_accessor :event_action
|
545
|
+
|
546
|
+
# The object on the page that was interacted with. Eg: 'Video'.
|
547
|
+
# Corresponds to the JSON property `eventCategory`
|
548
|
+
# @return [String]
|
549
|
+
attr_accessor :event_category
|
550
|
+
|
551
|
+
# Number of such events in this activity.
|
552
|
+
# Corresponds to the JSON property `eventCount`
|
553
|
+
# @return [Fixnum]
|
554
|
+
attr_accessor :event_count
|
555
|
+
|
556
|
+
# Label attached with the event.
|
557
|
+
# Corresponds to the JSON property `eventLabel`
|
558
|
+
# @return [String]
|
559
|
+
attr_accessor :event_label
|
560
|
+
|
561
|
+
# Numeric value associated with the event.
|
562
|
+
# Corresponds to the JSON property `eventValue`
|
563
|
+
# @return [Fixnum]
|
564
|
+
attr_accessor :event_value
|
565
|
+
|
566
|
+
def initialize(**args)
|
567
|
+
update!(**args)
|
568
|
+
end
|
569
|
+
|
570
|
+
# Update properties of this object
|
571
|
+
def update!(**args)
|
572
|
+
@event_action = args[:event_action] if args.key?(:event_action)
|
573
|
+
@event_category = args[:event_category] if args.key?(:event_category)
|
574
|
+
@event_count = args[:event_count] if args.key?(:event_count)
|
575
|
+
@event_label = args[:event_label] if args.key?(:event_label)
|
576
|
+
@event_value = args[:event_value] if args.key?(:event_value)
|
577
|
+
end
|
578
|
+
end
|
579
|
+
|
580
|
+
# The batch request containing multiple report request.
|
581
|
+
class GetReportsRequest
|
582
|
+
include Google::Apis::Core::Hashable
|
583
|
+
|
584
|
+
# Requests, each request will have a separate response. There can be a maximum
|
585
|
+
# of 5 requests. All requests should have the same `dateRanges`, `viewId`, `
|
586
|
+
# segments`, `samplingLevel`, and `cohortGroup`.
|
587
|
+
# Corresponds to the JSON property `reportRequests`
|
588
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::ReportRequest>]
|
589
|
+
attr_accessor :report_requests
|
590
|
+
|
591
|
+
# Enables [resource based quotas](/analytics/devguides/reporting/core/v4/limits-
|
592
|
+
# quotas#analytics_reporting_api_v4), (defaults to `False`). If this field is
|
593
|
+
# set to `True` the per view (profile) quotas are governed by the computational
|
594
|
+
# cost of the request. Note that using cost based quotas will higher enable
|
595
|
+
# sampling rates. (10 Million for `SMALL`, 100M for `LARGE`. See the [limits and
|
596
|
+
# quotas documentation](/analytics/devguides/reporting/core/v4/limits-quotas#
|
597
|
+
# analytics_reporting_api_v4) for details.
|
598
|
+
# Corresponds to the JSON property `useResourceQuotas`
|
599
|
+
# @return [Boolean]
|
600
|
+
attr_accessor :use_resource_quotas
|
601
|
+
alias_method :use_resource_quotas?, :use_resource_quotas
|
602
|
+
|
603
|
+
def initialize(**args)
|
604
|
+
update!(**args)
|
605
|
+
end
|
606
|
+
|
607
|
+
# Update properties of this object
|
608
|
+
def update!(**args)
|
609
|
+
@report_requests = args[:report_requests] if args.key?(:report_requests)
|
610
|
+
@use_resource_quotas = args[:use_resource_quotas] if args.key?(:use_resource_quotas)
|
611
|
+
end
|
612
|
+
end
|
613
|
+
|
614
|
+
# The main response class which holds the reports from the Reporting API `
|
615
|
+
# batchGet` call.
|
616
|
+
class GetReportsResponse
|
617
|
+
include Google::Apis::Core::Hashable
|
618
|
+
|
619
|
+
# The amount of resource quota tokens deducted to execute the query. Includes
|
620
|
+
# all responses.
|
621
|
+
# Corresponds to the JSON property `queryCost`
|
622
|
+
# @return [Fixnum]
|
623
|
+
attr_accessor :query_cost
|
624
|
+
|
625
|
+
# Responses corresponding to each of the request.
|
626
|
+
# Corresponds to the JSON property `reports`
|
627
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Report>]
|
628
|
+
attr_accessor :reports
|
629
|
+
|
630
|
+
# The resource quota tokens remaining for the property after the request is
|
631
|
+
# completed.
|
632
|
+
# Corresponds to the JSON property `resourceQuotasRemaining`
|
633
|
+
# @return [Google::Apis::AnalyticsreportingV4::ResourceQuotasRemaining]
|
634
|
+
attr_accessor :resource_quotas_remaining
|
635
|
+
|
636
|
+
def initialize(**args)
|
637
|
+
update!(**args)
|
638
|
+
end
|
639
|
+
|
640
|
+
# Update properties of this object
|
641
|
+
def update!(**args)
|
642
|
+
@query_cost = args[:query_cost] if args.key?(:query_cost)
|
643
|
+
@reports = args[:reports] if args.key?(:reports)
|
644
|
+
@resource_quotas_remaining = args[:resource_quotas_remaining] if args.key?(:resource_quotas_remaining)
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
# Represents all the details pertaining to a goal.
|
649
|
+
class GoalData
|
650
|
+
include Google::Apis::Core::Hashable
|
651
|
+
|
652
|
+
# URL of the page where this goal was completed.
|
653
|
+
# Corresponds to the JSON property `goalCompletionLocation`
|
654
|
+
# @return [String]
|
655
|
+
attr_accessor :goal_completion_location
|
656
|
+
|
657
|
+
# Total number of goal completions in this activity.
|
658
|
+
# Corresponds to the JSON property `goalCompletions`
|
659
|
+
# @return [Fixnum]
|
660
|
+
attr_accessor :goal_completions
|
661
|
+
|
662
|
+
# This identifies the goal as configured for the profile.
|
663
|
+
# Corresponds to the JSON property `goalIndex`
|
664
|
+
# @return [Fixnum]
|
665
|
+
attr_accessor :goal_index
|
666
|
+
|
667
|
+
# Name of the goal.
|
668
|
+
# Corresponds to the JSON property `goalName`
|
669
|
+
# @return [String]
|
670
|
+
attr_accessor :goal_name
|
671
|
+
|
672
|
+
# URL of the page one step prior to the goal completion.
|
673
|
+
# Corresponds to the JSON property `goalPreviousStep1`
|
674
|
+
# @return [String]
|
675
|
+
attr_accessor :goal_previous_step1
|
676
|
+
|
677
|
+
# URL of the page two steps prior to the goal completion.
|
678
|
+
# Corresponds to the JSON property `goalPreviousStep2`
|
679
|
+
# @return [String]
|
680
|
+
attr_accessor :goal_previous_step2
|
681
|
+
|
682
|
+
# URL of the page three steps prior to the goal completion.
|
683
|
+
# Corresponds to the JSON property `goalPreviousStep3`
|
684
|
+
# @return [String]
|
685
|
+
attr_accessor :goal_previous_step3
|
686
|
+
|
687
|
+
# Value in this goal.
|
688
|
+
# Corresponds to the JSON property `goalValue`
|
689
|
+
# @return [Float]
|
690
|
+
attr_accessor :goal_value
|
691
|
+
|
692
|
+
def initialize(**args)
|
693
|
+
update!(**args)
|
694
|
+
end
|
695
|
+
|
696
|
+
# Update properties of this object
|
697
|
+
def update!(**args)
|
698
|
+
@goal_completion_location = args[:goal_completion_location] if args.key?(:goal_completion_location)
|
699
|
+
@goal_completions = args[:goal_completions] if args.key?(:goal_completions)
|
700
|
+
@goal_index = args[:goal_index] if args.key?(:goal_index)
|
701
|
+
@goal_name = args[:goal_name] if args.key?(:goal_name)
|
702
|
+
@goal_previous_step1 = args[:goal_previous_step1] if args.key?(:goal_previous_step1)
|
703
|
+
@goal_previous_step2 = args[:goal_previous_step2] if args.key?(:goal_previous_step2)
|
704
|
+
@goal_previous_step3 = args[:goal_previous_step3] if args.key?(:goal_previous_step3)
|
705
|
+
@goal_value = args[:goal_value] if args.key?(:goal_value)
|
706
|
+
end
|
707
|
+
end
|
708
|
+
|
709
|
+
# Represents a set of goals that were reached in an activity.
|
710
|
+
class GoalSetData
|
711
|
+
include Google::Apis::Core::Hashable
|
712
|
+
|
713
|
+
# All the goals that were reached in the current activity.
|
714
|
+
# Corresponds to the JSON property `goals`
|
715
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::GoalData>]
|
716
|
+
attr_accessor :goals
|
717
|
+
|
718
|
+
def initialize(**args)
|
719
|
+
update!(**args)
|
720
|
+
end
|
721
|
+
|
722
|
+
# Update properties of this object
|
723
|
+
def update!(**args)
|
724
|
+
@goals = args[:goals] if args.key?(:goals)
|
725
|
+
end
|
726
|
+
end
|
727
|
+
|
728
|
+
# [Metrics](https://support.google.com/analytics/answer/1033861) are the
|
729
|
+
# quantitative measurements. For example, the metric `ga:users` indicates the
|
730
|
+
# total number of users for the requested time period.
|
731
|
+
class Metric
|
732
|
+
include Google::Apis::Core::Hashable
|
733
|
+
|
734
|
+
# An alias for the metric expression is an alternate name for the expression.
|
735
|
+
# The alias can be used for filtering and sorting. This field is optional and is
|
736
|
+
# useful if the expression is not a single metric but a complex expression which
|
737
|
+
# cannot be used in filtering and sorting. The alias is also used in the
|
738
|
+
# response column header.
|
739
|
+
# Corresponds to the JSON property `alias`
|
740
|
+
# @return [String]
|
741
|
+
attr_accessor :alias
|
742
|
+
|
743
|
+
# A metric expression in the request. An expression is constructed from one or
|
744
|
+
# more metrics and numbers. Accepted operators include: Plus (+), Minus (-),
|
745
|
+
# Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, Positive
|
746
|
+
# cardinal numbers (0-9), can include decimals and is limited to 1024 characters.
|
747
|
+
# Example `ga:totalRefunds/ga:users`, in most cases the metric expression is
|
748
|
+
# just a single metric name like `ga:users`. Adding mixed `MetricType` (E.g., `
|
749
|
+
# CURRENCY` + `PERCENTAGE`) metrics will result in unexpected results.
|
750
|
+
# Corresponds to the JSON property `expression`
|
751
|
+
# @return [String]
|
752
|
+
attr_accessor :expression
|
753
|
+
|
754
|
+
# Specifies how the metric expression should be formatted, for example `INTEGER`.
|
755
|
+
# Corresponds to the JSON property `formattingType`
|
756
|
+
# @return [String]
|
757
|
+
attr_accessor :formatting_type
|
758
|
+
|
759
|
+
def initialize(**args)
|
760
|
+
update!(**args)
|
761
|
+
end
|
762
|
+
|
763
|
+
# Update properties of this object
|
764
|
+
def update!(**args)
|
765
|
+
@alias = args[:alias] if args.key?(:alias)
|
766
|
+
@expression = args[:expression] if args.key?(:expression)
|
767
|
+
@formatting_type = args[:formatting_type] if args.key?(:formatting_type)
|
768
|
+
end
|
769
|
+
end
|
770
|
+
|
771
|
+
# MetricFilter specifies the filter on a metric.
|
772
|
+
class MetricFilter
|
773
|
+
include Google::Apis::Core::Hashable
|
774
|
+
|
775
|
+
# The value to compare against.
|
776
|
+
# Corresponds to the JSON property `comparisonValue`
|
777
|
+
# @return [String]
|
778
|
+
attr_accessor :comparison_value
|
779
|
+
|
780
|
+
# The metric that will be filtered on. A metricFilter must contain a metric name.
|
781
|
+
# A metric name can be an alias earlier defined as a metric or it can also be a
|
782
|
+
# metric expression.
|
783
|
+
# Corresponds to the JSON property `metricName`
|
784
|
+
# @return [String]
|
785
|
+
attr_accessor :metric_name
|
786
|
+
|
787
|
+
# Logical `NOT` operator. If this boolean is set to true, then the matching
|
788
|
+
# metric values will be excluded in the report. The default is false.
|
789
|
+
# Corresponds to the JSON property `not`
|
790
|
+
# @return [Boolean]
|
791
|
+
attr_accessor :not
|
792
|
+
alias_method :not?, :not
|
793
|
+
|
794
|
+
# Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the comparisonValue, the
|
795
|
+
# default is `EQUAL`. If the operator is `IS_MISSING`, checks if the metric is
|
796
|
+
# missing and would ignore the comparisonValue.
|
797
|
+
# Corresponds to the JSON property `operator`
|
798
|
+
# @return [String]
|
799
|
+
attr_accessor :operator
|
800
|
+
|
801
|
+
def initialize(**args)
|
802
|
+
update!(**args)
|
803
|
+
end
|
804
|
+
|
805
|
+
# Update properties of this object
|
806
|
+
def update!(**args)
|
807
|
+
@comparison_value = args[:comparison_value] if args.key?(:comparison_value)
|
808
|
+
@metric_name = args[:metric_name] if args.key?(:metric_name)
|
809
|
+
@not = args[:not] if args.key?(:not)
|
810
|
+
@operator = args[:operator] if args.key?(:operator)
|
811
|
+
end
|
812
|
+
end
|
813
|
+
|
814
|
+
# Represents a group of metric filters. Set the operator value to specify how
|
815
|
+
# the filters are logically combined.
|
816
|
+
class MetricFilterClause
|
817
|
+
include Google::Apis::Core::Hashable
|
818
|
+
|
819
|
+
# The repeated set of filters. They are logically combined based on the operator
|
820
|
+
# specified.
|
821
|
+
# Corresponds to the JSON property `filters`
|
822
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilter>]
|
823
|
+
attr_accessor :filters
|
824
|
+
|
825
|
+
# The operator for combining multiple metric filters. If unspecified, it is
|
826
|
+
# treated as an `OR`.
|
827
|
+
# Corresponds to the JSON property `operator`
|
828
|
+
# @return [String]
|
829
|
+
attr_accessor :operator
|
830
|
+
|
831
|
+
def initialize(**args)
|
832
|
+
update!(**args)
|
833
|
+
end
|
834
|
+
|
835
|
+
# Update properties of this object
|
836
|
+
def update!(**args)
|
837
|
+
@filters = args[:filters] if args.key?(:filters)
|
838
|
+
@operator = args[:operator] if args.key?(:operator)
|
839
|
+
end
|
840
|
+
end
|
841
|
+
|
842
|
+
# The headers for the metrics.
|
843
|
+
class MetricHeader
|
844
|
+
include Google::Apis::Core::Hashable
|
845
|
+
|
846
|
+
# Headers for the metrics in the response.
|
847
|
+
# Corresponds to the JSON property `metricHeaderEntries`
|
848
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::MetricHeaderEntry>]
|
849
|
+
attr_accessor :metric_header_entries
|
850
|
+
|
851
|
+
# Headers for the pivots in the response.
|
852
|
+
# Corresponds to the JSON property `pivotHeaders`
|
853
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeader>]
|
854
|
+
attr_accessor :pivot_headers
|
855
|
+
|
856
|
+
def initialize(**args)
|
857
|
+
update!(**args)
|
858
|
+
end
|
859
|
+
|
860
|
+
# Update properties of this object
|
861
|
+
def update!(**args)
|
862
|
+
@metric_header_entries = args[:metric_header_entries] if args.key?(:metric_header_entries)
|
863
|
+
@pivot_headers = args[:pivot_headers] if args.key?(:pivot_headers)
|
864
|
+
end
|
865
|
+
end
|
866
|
+
|
867
|
+
# Header for the metrics.
|
868
|
+
class MetricHeaderEntry
|
869
|
+
include Google::Apis::Core::Hashable
|
870
|
+
|
871
|
+
# The name of the header.
|
872
|
+
# Corresponds to the JSON property `name`
|
873
|
+
# @return [String]
|
874
|
+
attr_accessor :name
|
875
|
+
|
876
|
+
# The type of the metric, for example `INTEGER`.
|
877
|
+
# Corresponds to the JSON property `type`
|
878
|
+
# @return [String]
|
879
|
+
attr_accessor :type
|
880
|
+
|
881
|
+
def initialize(**args)
|
882
|
+
update!(**args)
|
883
|
+
end
|
884
|
+
|
885
|
+
# Update properties of this object
|
886
|
+
def update!(**args)
|
887
|
+
@name = args[:name] if args.key?(:name)
|
888
|
+
@type = args[:type] if args.key?(:type)
|
889
|
+
end
|
890
|
+
end
|
891
|
+
|
892
|
+
# A list of segment filters in the `OR` group are combined with the logical OR
|
893
|
+
# operator.
|
894
|
+
class OrFiltersForSegment
|
895
|
+
include Google::Apis::Core::Hashable
|
896
|
+
|
897
|
+
# List of segment filters to be combined with a `OR` operator.
|
898
|
+
# Corresponds to the JSON property `segmentFilterClauses`
|
899
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::SegmentFilterClause>]
|
900
|
+
attr_accessor :segment_filter_clauses
|
901
|
+
|
902
|
+
def initialize(**args)
|
903
|
+
update!(**args)
|
904
|
+
end
|
905
|
+
|
906
|
+
# Update properties of this object
|
907
|
+
def update!(**args)
|
908
|
+
@segment_filter_clauses = args[:segment_filter_clauses] if args.key?(:segment_filter_clauses)
|
909
|
+
end
|
910
|
+
end
|
911
|
+
|
912
|
+
# Specifies the sorting options.
|
913
|
+
class OrderBy
|
914
|
+
include Google::Apis::Core::Hashable
|
915
|
+
|
916
|
+
# The field which to sort by. The default sort order is ascending. Example: `ga:
|
917
|
+
# browser`. Note, that you can only specify one field for sort here. For example,
|
918
|
+
# `ga:browser, ga:city` is not valid.
|
919
|
+
# Corresponds to the JSON property `fieldName`
|
920
|
+
# @return [String]
|
921
|
+
attr_accessor :field_name
|
922
|
+
|
923
|
+
# The order type. The default orderType is `VALUE`.
|
924
|
+
# Corresponds to the JSON property `orderType`
|
925
|
+
# @return [String]
|
926
|
+
attr_accessor :order_type
|
927
|
+
|
928
|
+
# The sorting order for the field.
|
929
|
+
# Corresponds to the JSON property `sortOrder`
|
930
|
+
# @return [String]
|
931
|
+
attr_accessor :sort_order
|
932
|
+
|
933
|
+
def initialize(**args)
|
934
|
+
update!(**args)
|
935
|
+
end
|
936
|
+
|
937
|
+
# Update properties of this object
|
938
|
+
def update!(**args)
|
939
|
+
@field_name = args[:field_name] if args.key?(:field_name)
|
940
|
+
@order_type = args[:order_type] if args.key?(:order_type)
|
941
|
+
@sort_order = args[:sort_order] if args.key?(:sort_order)
|
942
|
+
end
|
943
|
+
end
|
944
|
+
|
945
|
+
# Represents details collected when the visitor views a page.
|
946
|
+
class PageviewData
|
947
|
+
include Google::Apis::Core::Hashable
|
948
|
+
|
949
|
+
# The URL of the page that the visitor viewed.
|
950
|
+
# Corresponds to the JSON property `pagePath`
|
951
|
+
# @return [String]
|
952
|
+
attr_accessor :page_path
|
953
|
+
|
954
|
+
# The title of the page that the visitor viewed.
|
955
|
+
# Corresponds to the JSON property `pageTitle`
|
956
|
+
# @return [String]
|
957
|
+
attr_accessor :page_title
|
958
|
+
|
959
|
+
def initialize(**args)
|
960
|
+
update!(**args)
|
961
|
+
end
|
962
|
+
|
963
|
+
# Update properties of this object
|
964
|
+
def update!(**args)
|
965
|
+
@page_path = args[:page_path] if args.key?(:page_path)
|
966
|
+
@page_title = args[:page_title] if args.key?(:page_title)
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
# The Pivot describes the pivot section in the request. The Pivot helps
|
971
|
+
# rearrange the information in the table for certain reports by pivoting your
|
972
|
+
# data on a second dimension.
|
973
|
+
class Pivot
|
974
|
+
include Google::Apis::Core::Hashable
|
975
|
+
|
976
|
+
# DimensionFilterClauses are logically combined with an `AND` operator: only
|
977
|
+
# data that is included by all these DimensionFilterClauses contributes to the
|
978
|
+
# values in this pivot region. Dimension filters can be used to restrict the
|
979
|
+
# columns shown in the pivot region. For example if you have `ga:browser` as the
|
980
|
+
# requested dimension in the pivot region, and you specify key filters to
|
981
|
+
# restrict `ga:browser` to only "IE" or "Firefox", then only those two browsers
|
982
|
+
# would show up as columns.
|
983
|
+
# Corresponds to the JSON property `dimensionFilterClauses`
|
984
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
|
985
|
+
attr_accessor :dimension_filter_clauses
|
986
|
+
|
987
|
+
# A list of dimensions to show as pivot columns. A Pivot can have a maximum of 4
|
988
|
+
# dimensions. Pivot dimensions are part of the restriction on the total number
|
989
|
+
# of dimensions allowed in the request.
|
990
|
+
# Corresponds to the JSON property `dimensions`
|
991
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Dimension>]
|
992
|
+
attr_accessor :dimensions
|
993
|
+
|
994
|
+
# Specifies the maximum number of groups to return. The default value is 10,
|
995
|
+
# also the maximum value is 1,000.
|
996
|
+
# Corresponds to the JSON property `maxGroupCount`
|
997
|
+
# @return [Fixnum]
|
998
|
+
attr_accessor :max_group_count
|
999
|
+
|
1000
|
+
# The pivot metrics. Pivot metrics are part of the restriction on total number
|
1001
|
+
# of metrics allowed in the request.
|
1002
|
+
# Corresponds to the JSON property `metrics`
|
1003
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
|
1004
|
+
attr_accessor :metrics
|
1005
|
+
|
1006
|
+
# If k metrics were requested, then the response will contain some data-
|
1007
|
+
# dependent multiple of k columns in the report. E.g., if you pivoted on the
|
1008
|
+
# dimension `ga:browser` then you'd get k columns for "Firefox", k columns for "
|
1009
|
+
# IE", k columns for "Chrome", etc. The ordering of the groups of columns is
|
1010
|
+
# determined by descending order of "total" for the first of the k values. Ties
|
1011
|
+
# are broken by lexicographic ordering of the first pivot dimension, then
|
1012
|
+
# lexicographic ordering of the second pivot dimension, and so on. E.g., if the
|
1013
|
+
# totals for the first value for Firefox, IE, and Chrome were 8, 2, 8,
|
1014
|
+
# respectively, the order of columns would be Chrome, Firefox, IE. The following
|
1015
|
+
# let you choose which of the groups of k columns are included in the response.
|
1016
|
+
# Corresponds to the JSON property `startGroup`
|
1017
|
+
# @return [Fixnum]
|
1018
|
+
attr_accessor :start_group
|
1019
|
+
|
1020
|
+
def initialize(**args)
|
1021
|
+
update!(**args)
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
# Update properties of this object
|
1025
|
+
def update!(**args)
|
1026
|
+
@dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses)
|
1027
|
+
@dimensions = args[:dimensions] if args.key?(:dimensions)
|
1028
|
+
@max_group_count = args[:max_group_count] if args.key?(:max_group_count)
|
1029
|
+
@metrics = args[:metrics] if args.key?(:metrics)
|
1030
|
+
@start_group = args[:start_group] if args.key?(:start_group)
|
1031
|
+
end
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
# The headers for each of the pivot sections defined in the request.
|
1035
|
+
class PivotHeader
|
1036
|
+
include Google::Apis::Core::Hashable
|
1037
|
+
|
1038
|
+
# A single pivot section header.
|
1039
|
+
# Corresponds to the JSON property `pivotHeaderEntries`
|
1040
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeaderEntry>]
|
1041
|
+
attr_accessor :pivot_header_entries
|
1042
|
+
|
1043
|
+
# The total number of groups for this pivot.
|
1044
|
+
# Corresponds to the JSON property `totalPivotGroupsCount`
|
1045
|
+
# @return [Fixnum]
|
1046
|
+
attr_accessor :total_pivot_groups_count
|
1047
|
+
|
1048
|
+
def initialize(**args)
|
1049
|
+
update!(**args)
|
1050
|
+
end
|
1051
|
+
|
1052
|
+
# Update properties of this object
|
1053
|
+
def update!(**args)
|
1054
|
+
@pivot_header_entries = args[:pivot_header_entries] if args.key?(:pivot_header_entries)
|
1055
|
+
@total_pivot_groups_count = args[:total_pivot_groups_count] if args.key?(:total_pivot_groups_count)
|
1056
|
+
end
|
1057
|
+
end
|
1058
|
+
|
1059
|
+
# The headers for the each of the metric column corresponding to the metrics
|
1060
|
+
# requested in the pivots section of the response.
|
1061
|
+
class PivotHeaderEntry
|
1062
|
+
include Google::Apis::Core::Hashable
|
1063
|
+
|
1064
|
+
# The name of the dimensions in the pivot response.
|
1065
|
+
# Corresponds to the JSON property `dimensionNames`
|
1066
|
+
# @return [Array<String>]
|
1067
|
+
attr_accessor :dimension_names
|
1068
|
+
|
1069
|
+
# The values for the dimensions in the pivot.
|
1070
|
+
# Corresponds to the JSON property `dimensionValues`
|
1071
|
+
# @return [Array<String>]
|
1072
|
+
attr_accessor :dimension_values
|
1073
|
+
|
1074
|
+
# Header for the metrics.
|
1075
|
+
# Corresponds to the JSON property `metric`
|
1076
|
+
# @return [Google::Apis::AnalyticsreportingV4::MetricHeaderEntry]
|
1077
|
+
attr_accessor :metric
|
1078
|
+
|
1079
|
+
def initialize(**args)
|
1080
|
+
update!(**args)
|
1081
|
+
end
|
1082
|
+
|
1083
|
+
# Update properties of this object
|
1084
|
+
def update!(**args)
|
1085
|
+
@dimension_names = args[:dimension_names] if args.key?(:dimension_names)
|
1086
|
+
@dimension_values = args[:dimension_values] if args.key?(:dimension_values)
|
1087
|
+
@metric = args[:metric] if args.key?(:metric)
|
1088
|
+
end
|
1089
|
+
end
|
1090
|
+
|
1091
|
+
# The metric values in the pivot region.
|
1092
|
+
class PivotValueRegion
|
1093
|
+
include Google::Apis::Core::Hashable
|
1094
|
+
|
1095
|
+
# The values of the metrics in each of the pivot regions.
|
1096
|
+
# Corresponds to the JSON property `values`
|
1097
|
+
# @return [Array<String>]
|
1098
|
+
attr_accessor :values
|
1099
|
+
|
1100
|
+
def initialize(**args)
|
1101
|
+
update!(**args)
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
# Update properties of this object
|
1105
|
+
def update!(**args)
|
1106
|
+
@values = args[:values] if args.key?(:values)
|
1107
|
+
end
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
# Details of the products in an e-commerce transaction.
|
1111
|
+
class ProductData
|
1112
|
+
include Google::Apis::Core::Hashable
|
1113
|
+
|
1114
|
+
# The total revenue from purchased product items.
|
1115
|
+
# Corresponds to the JSON property `itemRevenue`
|
1116
|
+
# @return [Float]
|
1117
|
+
attr_accessor :item_revenue
|
1118
|
+
|
1119
|
+
# The product name, supplied by the e-commerce tracking application, for the
|
1120
|
+
# purchased items.
|
1121
|
+
# Corresponds to the JSON property `productName`
|
1122
|
+
# @return [String]
|
1123
|
+
attr_accessor :product_name
|
1124
|
+
|
1125
|
+
# Total number of this product units in the transaction.
|
1126
|
+
# Corresponds to the JSON property `productQuantity`
|
1127
|
+
# @return [Fixnum]
|
1128
|
+
attr_accessor :product_quantity
|
1129
|
+
|
1130
|
+
# Unique code that represents the product.
|
1131
|
+
# Corresponds to the JSON property `productSku`
|
1132
|
+
# @return [String]
|
1133
|
+
attr_accessor :product_sku
|
1134
|
+
|
1135
|
+
def initialize(**args)
|
1136
|
+
update!(**args)
|
1137
|
+
end
|
1138
|
+
|
1139
|
+
# Update properties of this object
|
1140
|
+
def update!(**args)
|
1141
|
+
@item_revenue = args[:item_revenue] if args.key?(:item_revenue)
|
1142
|
+
@product_name = args[:product_name] if args.key?(:product_name)
|
1143
|
+
@product_quantity = args[:product_quantity] if args.key?(:product_quantity)
|
1144
|
+
@product_sku = args[:product_sku] if args.key?(:product_sku)
|
1145
|
+
end
|
1146
|
+
end
|
1147
|
+
|
1148
|
+
# The data response corresponding to the request.
|
1149
|
+
class Report
|
1150
|
+
include Google::Apis::Core::Hashable
|
1151
|
+
|
1152
|
+
# Column headers.
|
1153
|
+
# Corresponds to the JSON property `columnHeader`
|
1154
|
+
# @return [Google::Apis::AnalyticsreportingV4::ColumnHeader]
|
1155
|
+
attr_accessor :column_header
|
1156
|
+
|
1157
|
+
# The data part of the report.
|
1158
|
+
# Corresponds to the JSON property `data`
|
1159
|
+
# @return [Google::Apis::AnalyticsreportingV4::ReportData]
|
1160
|
+
attr_accessor :data
|
1161
|
+
|
1162
|
+
# Page token to retrieve the next page of results in the list.
|
1163
|
+
# Corresponds to the JSON property `nextPageToken`
|
1164
|
+
# @return [String]
|
1165
|
+
attr_accessor :next_page_token
|
1166
|
+
|
1167
|
+
def initialize(**args)
|
1168
|
+
update!(**args)
|
1169
|
+
end
|
1170
|
+
|
1171
|
+
# Update properties of this object
|
1172
|
+
def update!(**args)
|
1173
|
+
@column_header = args[:column_header] if args.key?(:column_header)
|
1174
|
+
@data = args[:data] if args.key?(:data)
|
1175
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
1176
|
+
end
|
1177
|
+
end
|
1178
|
+
|
1179
|
+
# The data part of the report.
|
1180
|
+
class ReportData
|
1181
|
+
include Google::Apis::Core::Hashable
|
1182
|
+
|
1183
|
+
# The last time the data in the report was refreshed. All the hits received
|
1184
|
+
# before this timestamp are included in the calculation of the report.
|
1185
|
+
# Corresponds to the JSON property `dataLastRefreshed`
|
1186
|
+
# @return [String]
|
1187
|
+
attr_accessor :data_last_refreshed
|
1188
|
+
|
1189
|
+
# Indicates if response to this request is golden or not. Data is golden when
|
1190
|
+
# the exact same request will not produce any new results if asked at a later
|
1191
|
+
# point in time.
|
1192
|
+
# Corresponds to the JSON property `isDataGolden`
|
1193
|
+
# @return [Boolean]
|
1194
|
+
attr_accessor :is_data_golden
|
1195
|
+
alias_method :is_data_golden?, :is_data_golden
|
1196
|
+
|
1197
|
+
# Minimum and maximum values seen over all matching rows. These are both empty
|
1198
|
+
# when `hideValueRanges` in the request is false, or when rowCount is zero.
|
1199
|
+
# Corresponds to the JSON property `maximums`
|
1200
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
|
1201
|
+
attr_accessor :maximums
|
1202
|
+
|
1203
|
+
# Minimum and maximum values seen over all matching rows. These are both empty
|
1204
|
+
# when `hideValueRanges` in the request is false, or when rowCount is zero.
|
1205
|
+
# Corresponds to the JSON property `minimums`
|
1206
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
|
1207
|
+
attr_accessor :minimums
|
1208
|
+
|
1209
|
+
# Total number of matching rows for this query.
|
1210
|
+
# Corresponds to the JSON property `rowCount`
|
1211
|
+
# @return [Fixnum]
|
1212
|
+
attr_accessor :row_count
|
1213
|
+
|
1214
|
+
# There's one ReportRow for every unique combination of dimensions.
|
1215
|
+
# Corresponds to the JSON property `rows`
|
1216
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::ReportRow>]
|
1217
|
+
attr_accessor :rows
|
1218
|
+
|
1219
|
+
# If the results are [sampled](https://support.google.com/analytics/answer/
|
1220
|
+
# 2637192), this returns the total number of samples read, one entry per date
|
1221
|
+
# range. If the results are not sampled this field will not be defined. See [
|
1222
|
+
# developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for
|
1223
|
+
# details.
|
1224
|
+
# Corresponds to the JSON property `samplesReadCounts`
|
1225
|
+
# @return [Array<Fixnum>]
|
1226
|
+
attr_accessor :samples_read_counts
|
1227
|
+
|
1228
|
+
# If the results are [sampled](https://support.google.com/analytics/answer/
|
1229
|
+
# 2637192), this returns the total number of samples present, one entry per date
|
1230
|
+
# range. If the results are not sampled this field will not be defined. See [
|
1231
|
+
# developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for
|
1232
|
+
# details.
|
1233
|
+
# Corresponds to the JSON property `samplingSpaceSizes`
|
1234
|
+
# @return [Array<Fixnum>]
|
1235
|
+
attr_accessor :sampling_space_sizes
|
1236
|
+
|
1237
|
+
# For each requested date range, for the set of all rows that match the query,
|
1238
|
+
# every requested value format gets a total. The total for a value format is
|
1239
|
+
# computed by first totaling the metrics mentioned in the value format and then
|
1240
|
+
# evaluating the value format as a scalar expression. E.g., The "totals" for `3 /
|
1241
|
+
# (ga:sessions + 2)` we compute `3 / ((sum of all relevant ga:sessions) + 2)`.
|
1242
|
+
# Totals are computed before pagination.
|
1243
|
+
# Corresponds to the JSON property `totals`
|
1244
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
|
1245
|
+
attr_accessor :totals
|
1246
|
+
|
1247
|
+
def initialize(**args)
|
1248
|
+
update!(**args)
|
1249
|
+
end
|
1250
|
+
|
1251
|
+
# Update properties of this object
|
1252
|
+
def update!(**args)
|
1253
|
+
@data_last_refreshed = args[:data_last_refreshed] if args.key?(:data_last_refreshed)
|
1254
|
+
@is_data_golden = args[:is_data_golden] if args.key?(:is_data_golden)
|
1255
|
+
@maximums = args[:maximums] if args.key?(:maximums)
|
1256
|
+
@minimums = args[:minimums] if args.key?(:minimums)
|
1257
|
+
@row_count = args[:row_count] if args.key?(:row_count)
|
1258
|
+
@rows = args[:rows] if args.key?(:rows)
|
1259
|
+
@samples_read_counts = args[:samples_read_counts] if args.key?(:samples_read_counts)
|
1260
|
+
@sampling_space_sizes = args[:sampling_space_sizes] if args.key?(:sampling_space_sizes)
|
1261
|
+
@totals = args[:totals] if args.key?(:totals)
|
1262
|
+
end
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
# The main request class which specifies the Reporting API request.
|
1266
|
+
class ReportRequest
|
1267
|
+
include Google::Apis::Core::Hashable
|
1268
|
+
|
1269
|
+
# Defines a cohort group. For example: "cohortGroup": ` "cohorts": [` "name": "
|
1270
|
+
# cohort 1", "type": "FIRST_VISIT_DATE", "dateRange": ` "startDate": "2015-08-01"
|
1271
|
+
# , "endDate": "2015-08-01" ` `,` "name": "cohort 2" "type": "FIRST_VISIT_DATE" "
|
1272
|
+
# dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" ` `] `
|
1273
|
+
# Corresponds to the JSON property `cohortGroup`
|
1274
|
+
# @return [Google::Apis::AnalyticsreportingV4::CohortGroup]
|
1275
|
+
attr_accessor :cohort_group
|
1276
|
+
|
1277
|
+
# Date ranges in the request. The request can have a maximum of 2 date ranges.
|
1278
|
+
# The response will contain a set of metric values for each combination of the
|
1279
|
+
# dimensions for each date range in the request. So, if there are two date
|
1280
|
+
# ranges, there will be two set of metric values, one for the original date
|
1281
|
+
# range and one for the second date range. The `reportRequest.dateRanges` field
|
1282
|
+
# should not be specified for cohorts or Lifetime value requests. If a date
|
1283
|
+
# range is not provided, the default date range is (startDate: current date - 7
|
1284
|
+
# days, endDate: current date - 1 day). Every [ReportRequest](#ReportRequest)
|
1285
|
+
# within a `batchGet` method must contain the same `dateRanges` definition.
|
1286
|
+
# Corresponds to the JSON property `dateRanges`
|
1287
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DateRange>]
|
1288
|
+
attr_accessor :date_ranges
|
1289
|
+
|
1290
|
+
# The dimension filter clauses for filtering Dimension Values. They are
|
1291
|
+
# logically combined with the `AND` operator. Note that filtering occurs before
|
1292
|
+
# any dimensions are aggregated, so that the returned metrics represent the
|
1293
|
+
# total for only the relevant dimensions.
|
1294
|
+
# Corresponds to the JSON property `dimensionFilterClauses`
|
1295
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
|
1296
|
+
attr_accessor :dimension_filter_clauses
|
1297
|
+
|
1298
|
+
# The dimensions requested. Requests can have a total of 9 dimensions.
|
1299
|
+
# Corresponds to the JSON property `dimensions`
|
1300
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Dimension>]
|
1301
|
+
attr_accessor :dimensions
|
1302
|
+
|
1303
|
+
# Dimension or metric filters that restrict the data returned for your request.
|
1304
|
+
# To use the `filtersExpression`, supply a dimension or metric on which to
|
1305
|
+
# filter, followed by the filter expression. For example, the following
|
1306
|
+
# expression selects `ga:browser` dimension which starts with Firefox; `ga:
|
1307
|
+
# browser=~^Firefox`. For more information on dimensions and metric filters, see
|
1308
|
+
# [Filters reference](https://developers.google.com/analytics/devguides/
|
1309
|
+
# reporting/core/v3/reference#filters).
|
1310
|
+
# Corresponds to the JSON property `filtersExpression`
|
1311
|
+
# @return [String]
|
1312
|
+
attr_accessor :filters_expression
|
1313
|
+
|
1314
|
+
# If set to true, hides the total of all metrics for all the matching rows, for
|
1315
|
+
# every date range. The default false and will return the totals.
|
1316
|
+
# Corresponds to the JSON property `hideTotals`
|
1317
|
+
# @return [Boolean]
|
1318
|
+
attr_accessor :hide_totals
|
1319
|
+
alias_method :hide_totals?, :hide_totals
|
1320
|
+
|
1321
|
+
# If set to true, hides the minimum and maximum across all matching rows. The
|
1322
|
+
# default is false and the value ranges are returned.
|
1323
|
+
# Corresponds to the JSON property `hideValueRanges`
|
1324
|
+
# @return [Boolean]
|
1325
|
+
attr_accessor :hide_value_ranges
|
1326
|
+
alias_method :hide_value_ranges?, :hide_value_ranges
|
1327
|
+
|
1328
|
+
# If set to false, the response does not include rows if all the retrieved
|
1329
|
+
# metrics are equal to zero. The default is false which will exclude these rows.
|
1330
|
+
# Corresponds to the JSON property `includeEmptyRows`
|
1331
|
+
# @return [Boolean]
|
1332
|
+
attr_accessor :include_empty_rows
|
1333
|
+
alias_method :include_empty_rows?, :include_empty_rows
|
1334
|
+
|
1335
|
+
# The metric filter clauses. They are logically combined with the `AND` operator.
|
1336
|
+
# Metric filters look at only the first date range and not the comparing date
|
1337
|
+
# range. Note that filtering on metrics occurs after the metrics are aggregated.
|
1338
|
+
# Corresponds to the JSON property `metricFilterClauses`
|
1339
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilterClause>]
|
1340
|
+
attr_accessor :metric_filter_clauses
|
1341
|
+
|
1342
|
+
# The metrics requested. Requests must specify at least one metric. Requests can
|
1343
|
+
# have a total of 10 metrics.
|
1344
|
+
# Corresponds to the JSON property `metrics`
|
1345
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
|
1346
|
+
attr_accessor :metrics
|
1347
|
+
|
1348
|
+
# Sort order on output rows. To compare two rows, the elements of the following
|
1349
|
+
# are applied in order until a difference is found. All date ranges in the
|
1350
|
+
# output get the same row order.
|
1351
|
+
# Corresponds to the JSON property `orderBys`
|
1352
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::OrderBy>]
|
1353
|
+
attr_accessor :order_bys
|
1354
|
+
|
1355
|
+
# Page size is for paging and specifies the maximum number of returned rows.
|
1356
|
+
# Page size should be >= 0. A query returns the default of 1,000 rows. The
|
1357
|
+
# Analytics Core Reporting API returns a maximum of 100,000 rows per request, no
|
1358
|
+
# matter how many you ask for. It can also return fewer rows than requested, if
|
1359
|
+
# there aren't as many dimension segments as you expect. For instance, there are
|
1360
|
+
# fewer than 300 possible values for `ga:country`, so when segmenting only by
|
1361
|
+
# country, you can't get more than 300 rows, even if you set `pageSize` to a
|
1362
|
+
# higher value.
|
1363
|
+
# Corresponds to the JSON property `pageSize`
|
1364
|
+
# @return [Fixnum]
|
1365
|
+
attr_accessor :page_size
|
1366
|
+
|
1367
|
+
# A continuation token to get the next page of the results. Adding this to the
|
1368
|
+
# request will return the rows after the pageToken. The pageToken should be the
|
1369
|
+
# value returned in the nextPageToken parameter in the response to the
|
1370
|
+
# GetReports request.
|
1371
|
+
# Corresponds to the JSON property `pageToken`
|
1372
|
+
# @return [String]
|
1373
|
+
attr_accessor :page_token
|
1374
|
+
|
1375
|
+
# The pivot definitions. Requests can have a maximum of 2 pivots.
|
1376
|
+
# Corresponds to the JSON property `pivots`
|
1377
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Pivot>]
|
1378
|
+
attr_accessor :pivots
|
1379
|
+
|
1380
|
+
# The desired report [sample](https://support.google.com/analytics/answer/
|
1381
|
+
# 2637192) size. If the the `samplingLevel` field is unspecified the `DEFAULT`
|
1382
|
+
# sampling level is used. Every [ReportRequest](#ReportRequest) within a `
|
1383
|
+
# batchGet` method must contain the same `samplingLevel` definition. See [
|
1384
|
+
# developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for
|
1385
|
+
# details.
|
1386
|
+
# Corresponds to the JSON property `samplingLevel`
|
1387
|
+
# @return [String]
|
1388
|
+
attr_accessor :sampling_level
|
1389
|
+
|
1390
|
+
# Segment the data returned for the request. A segment definition helps look at
|
1391
|
+
# a subset of the segment request. A request can contain up to four segments.
|
1392
|
+
# Every [ReportRequest](#ReportRequest) within a `batchGet` method must contain
|
1393
|
+
# the same `segments` definition. Requests with segments must have the `ga:
|
1394
|
+
# segment` dimension.
|
1395
|
+
# Corresponds to the JSON property `segments`
|
1396
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Segment>]
|
1397
|
+
attr_accessor :segments
|
1398
|
+
|
1399
|
+
# The Analytics [view ID](https://support.google.com/analytics/answer/1009618)
|
1400
|
+
# from which to retrieve data. Every [ReportRequest](#ReportRequest) within a `
|
1401
|
+
# batchGet` method must contain the same `viewId`.
|
1402
|
+
# Corresponds to the JSON property `viewId`
|
1403
|
+
# @return [String]
|
1404
|
+
attr_accessor :view_id
|
1405
|
+
|
1406
|
+
def initialize(**args)
|
1407
|
+
update!(**args)
|
1408
|
+
end
|
1409
|
+
|
1410
|
+
# Update properties of this object
|
1411
|
+
def update!(**args)
|
1412
|
+
@cohort_group = args[:cohort_group] if args.key?(:cohort_group)
|
1413
|
+
@date_ranges = args[:date_ranges] if args.key?(:date_ranges)
|
1414
|
+
@dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses)
|
1415
|
+
@dimensions = args[:dimensions] if args.key?(:dimensions)
|
1416
|
+
@filters_expression = args[:filters_expression] if args.key?(:filters_expression)
|
1417
|
+
@hide_totals = args[:hide_totals] if args.key?(:hide_totals)
|
1418
|
+
@hide_value_ranges = args[:hide_value_ranges] if args.key?(:hide_value_ranges)
|
1419
|
+
@include_empty_rows = args[:include_empty_rows] if args.key?(:include_empty_rows)
|
1420
|
+
@metric_filter_clauses = args[:metric_filter_clauses] if args.key?(:metric_filter_clauses)
|
1421
|
+
@metrics = args[:metrics] if args.key?(:metrics)
|
1422
|
+
@order_bys = args[:order_bys] if args.key?(:order_bys)
|
1423
|
+
@page_size = args[:page_size] if args.key?(:page_size)
|
1424
|
+
@page_token = args[:page_token] if args.key?(:page_token)
|
1425
|
+
@pivots = args[:pivots] if args.key?(:pivots)
|
1426
|
+
@sampling_level = args[:sampling_level] if args.key?(:sampling_level)
|
1427
|
+
@segments = args[:segments] if args.key?(:segments)
|
1428
|
+
@view_id = args[:view_id] if args.key?(:view_id)
|
1429
|
+
end
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
# A row in the report.
|
1433
|
+
class ReportRow
|
1434
|
+
include Google::Apis::Core::Hashable
|
1435
|
+
|
1436
|
+
# List of requested dimensions.
|
1437
|
+
# Corresponds to the JSON property `dimensions`
|
1438
|
+
# @return [Array<String>]
|
1439
|
+
attr_accessor :dimensions
|
1440
|
+
|
1441
|
+
# List of metrics for each requested DateRange.
|
1442
|
+
# Corresponds to the JSON property `metrics`
|
1443
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
|
1444
|
+
attr_accessor :metrics
|
1445
|
+
|
1446
|
+
def initialize(**args)
|
1447
|
+
update!(**args)
|
1448
|
+
end
|
1449
|
+
|
1450
|
+
# Update properties of this object
|
1451
|
+
def update!(**args)
|
1452
|
+
@dimensions = args[:dimensions] if args.key?(:dimensions)
|
1453
|
+
@metrics = args[:metrics] if args.key?(:metrics)
|
1454
|
+
end
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
# The resource quota tokens remaining for the property after the request is
|
1458
|
+
# completed.
|
1459
|
+
class ResourceQuotasRemaining
|
1460
|
+
include Google::Apis::Core::Hashable
|
1461
|
+
|
1462
|
+
# Daily resource quota remaining remaining.
|
1463
|
+
# Corresponds to the JSON property `dailyQuotaTokensRemaining`
|
1464
|
+
# @return [Fixnum]
|
1465
|
+
attr_accessor :daily_quota_tokens_remaining
|
1466
|
+
|
1467
|
+
# Hourly resource quota tokens remaining.
|
1468
|
+
# Corresponds to the JSON property `hourlyQuotaTokensRemaining`
|
1469
|
+
# @return [Fixnum]
|
1470
|
+
attr_accessor :hourly_quota_tokens_remaining
|
1471
|
+
|
1472
|
+
def initialize(**args)
|
1473
|
+
update!(**args)
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
# Update properties of this object
|
1477
|
+
def update!(**args)
|
1478
|
+
@daily_quota_tokens_remaining = args[:daily_quota_tokens_remaining] if args.key?(:daily_quota_tokens_remaining)
|
1479
|
+
@hourly_quota_tokens_remaining = args[:hourly_quota_tokens_remaining] if args.key?(:hourly_quota_tokens_remaining)
|
1480
|
+
end
|
1481
|
+
end
|
1482
|
+
|
1483
|
+
#
|
1484
|
+
class ScreenviewData
|
1485
|
+
include Google::Apis::Core::Hashable
|
1486
|
+
|
1487
|
+
# The application name.
|
1488
|
+
# Corresponds to the JSON property `appName`
|
1489
|
+
# @return [String]
|
1490
|
+
attr_accessor :app_name
|
1491
|
+
|
1492
|
+
# Mobile manufacturer or branded name. Eg: "Google", "Apple" etc.
|
1493
|
+
# Corresponds to the JSON property `mobileDeviceBranding`
|
1494
|
+
# @return [String]
|
1495
|
+
attr_accessor :mobile_device_branding
|
1496
|
+
|
1497
|
+
# Mobile device model. Eg: "Pixel", "iPhone" etc.
|
1498
|
+
# Corresponds to the JSON property `mobileDeviceModel`
|
1499
|
+
# @return [String]
|
1500
|
+
attr_accessor :mobile_device_model
|
1501
|
+
|
1502
|
+
# The name of the screen.
|
1503
|
+
# Corresponds to the JSON property `screenName`
|
1504
|
+
# @return [String]
|
1505
|
+
attr_accessor :screen_name
|
1506
|
+
|
1507
|
+
def initialize(**args)
|
1508
|
+
update!(**args)
|
1509
|
+
end
|
1510
|
+
|
1511
|
+
# Update properties of this object
|
1512
|
+
def update!(**args)
|
1513
|
+
@app_name = args[:app_name] if args.key?(:app_name)
|
1514
|
+
@mobile_device_branding = args[:mobile_device_branding] if args.key?(:mobile_device_branding)
|
1515
|
+
@mobile_device_model = args[:mobile_device_model] if args.key?(:mobile_device_model)
|
1516
|
+
@screen_name = args[:screen_name] if args.key?(:screen_name)
|
1517
|
+
end
|
1518
|
+
end
|
1519
|
+
|
1520
|
+
# The request to fetch User Report from Reporting API `userActivity:get` call.
|
1521
|
+
class SearchUserActivityRequest
|
1522
|
+
include Google::Apis::Core::Hashable
|
1523
|
+
|
1524
|
+
# Set of all activity types being requested. Only acvities matching these types
|
1525
|
+
# will be returned in the response. If empty, all activies will be returned.
|
1526
|
+
# Corresponds to the JSON property `activityTypes`
|
1527
|
+
# @return [Array<String>]
|
1528
|
+
attr_accessor :activity_types
|
1529
|
+
|
1530
|
+
# A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The
|
1531
|
+
# start and end dates are specified in [ISO8601](https://en.wikipedia.org/wiki/
|
1532
|
+
# ISO_8601) date format `YYYY-MM-DD`.
|
1533
|
+
# Corresponds to the JSON property `dateRange`
|
1534
|
+
# @return [Google::Apis::AnalyticsreportingV4::DateRange]
|
1535
|
+
attr_accessor :date_range
|
1536
|
+
|
1537
|
+
# Page size is for paging and specifies the maximum number of returned rows.
|
1538
|
+
# Page size should be > 0. If the value is 0 or if the field isn't specified,
|
1539
|
+
# the request returns the default of 1000 rows per page.
|
1540
|
+
# Corresponds to the JSON property `pageSize`
|
1541
|
+
# @return [Fixnum]
|
1542
|
+
attr_accessor :page_size
|
1543
|
+
|
1544
|
+
# A continuation token to get the next page of the results. Adding this to the
|
1545
|
+
# request will return the rows after the pageToken. The pageToken should be the
|
1546
|
+
# value returned in the nextPageToken parameter in the response to the [
|
1547
|
+
# SearchUserActivityRequest](#SearchUserActivityRequest) request.
|
1548
|
+
# Corresponds to the JSON property `pageToken`
|
1549
|
+
# @return [String]
|
1550
|
+
attr_accessor :page_token
|
1551
|
+
|
1552
|
+
# Contains information to identify a particular user uniquely.
|
1553
|
+
# Corresponds to the JSON property `user`
|
1554
|
+
# @return [Google::Apis::AnalyticsreportingV4::User]
|
1555
|
+
attr_accessor :user
|
1556
|
+
|
1557
|
+
# Required. The Analytics [view ID](https://support.google.com/analytics/answer/
|
1558
|
+
# 1009618) from which to retrieve data. Every [SearchUserActivityRequest](#
|
1559
|
+
# SearchUserActivityRequest) must contain the `viewId`.
|
1560
|
+
# Corresponds to the JSON property `viewId`
|
1561
|
+
# @return [String]
|
1562
|
+
attr_accessor :view_id
|
1563
|
+
|
1564
|
+
def initialize(**args)
|
1565
|
+
update!(**args)
|
1566
|
+
end
|
1567
|
+
|
1568
|
+
# Update properties of this object
|
1569
|
+
def update!(**args)
|
1570
|
+
@activity_types = args[:activity_types] if args.key?(:activity_types)
|
1571
|
+
@date_range = args[:date_range] if args.key?(:date_range)
|
1572
|
+
@page_size = args[:page_size] if args.key?(:page_size)
|
1573
|
+
@page_token = args[:page_token] if args.key?(:page_token)
|
1574
|
+
@user = args[:user] if args.key?(:user)
|
1575
|
+
@view_id = args[:view_id] if args.key?(:view_id)
|
1576
|
+
end
|
1577
|
+
end
|
1578
|
+
|
1579
|
+
# The response from `userActivity:get` call.
|
1580
|
+
class SearchUserActivityResponse
|
1581
|
+
include Google::Apis::Core::Hashable
|
1582
|
+
|
1583
|
+
# This token should be passed to [SearchUserActivityRequest](#
|
1584
|
+
# SearchUserActivityRequest) to retrieve the next page.
|
1585
|
+
# Corresponds to the JSON property `nextPageToken`
|
1586
|
+
# @return [String]
|
1587
|
+
attr_accessor :next_page_token
|
1588
|
+
|
1589
|
+
# This field represents the [sampling rate](https://support.google.com/analytics/
|
1590
|
+
# answer/2637192) for the given request and is a number between 0.0 to 1.0. See [
|
1591
|
+
# developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for
|
1592
|
+
# details.
|
1593
|
+
# Corresponds to the JSON property `sampleRate`
|
1594
|
+
# @return [Float]
|
1595
|
+
attr_accessor :sample_rate
|
1596
|
+
|
1597
|
+
# Each record represents a session (device details, duration, etc).
|
1598
|
+
# Corresponds to the JSON property `sessions`
|
1599
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::UserActivitySession>]
|
1600
|
+
attr_accessor :sessions
|
1601
|
+
|
1602
|
+
# Total rows returned by this query (across different pages).
|
1603
|
+
# Corresponds to the JSON property `totalRows`
|
1604
|
+
# @return [Fixnum]
|
1605
|
+
attr_accessor :total_rows
|
1606
|
+
|
1607
|
+
def initialize(**args)
|
1608
|
+
update!(**args)
|
1609
|
+
end
|
1610
|
+
|
1611
|
+
# Update properties of this object
|
1612
|
+
def update!(**args)
|
1613
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
1614
|
+
@sample_rate = args[:sample_rate] if args.key?(:sample_rate)
|
1615
|
+
@sessions = args[:sessions] if args.key?(:sessions)
|
1616
|
+
@total_rows = args[:total_rows] if args.key?(:total_rows)
|
1617
|
+
end
|
1618
|
+
end
|
1619
|
+
|
1620
|
+
# The segment definition, if the report needs to be segmented. A Segment is a
|
1621
|
+
# subset of the Analytics data. For example, of the entire set of users, one
|
1622
|
+
# Segment might be users from a particular country or city.
|
1623
|
+
class Segment
|
1624
|
+
include Google::Apis::Core::Hashable
|
1625
|
+
|
1626
|
+
# Dynamic segment definition for defining the segment within the request. A
|
1627
|
+
# segment can select users, sessions or both.
|
1628
|
+
# Corresponds to the JSON property `dynamicSegment`
|
1629
|
+
# @return [Google::Apis::AnalyticsreportingV4::DynamicSegment]
|
1630
|
+
attr_accessor :dynamic_segment
|
1631
|
+
|
1632
|
+
# The segment ID of a built-in or custom segment, for example `gaid::-3`.
|
1633
|
+
# Corresponds to the JSON property `segmentId`
|
1634
|
+
# @return [String]
|
1635
|
+
attr_accessor :segment_id
|
1636
|
+
|
1637
|
+
def initialize(**args)
|
1638
|
+
update!(**args)
|
1639
|
+
end
|
1640
|
+
|
1641
|
+
# Update properties of this object
|
1642
|
+
def update!(**args)
|
1643
|
+
@dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)
|
1644
|
+
@segment_id = args[:segment_id] if args.key?(:segment_id)
|
1645
|
+
end
|
1646
|
+
end
|
1647
|
+
|
1648
|
+
# SegmentDefinition defines the segment to be a set of SegmentFilters which are
|
1649
|
+
# combined together with a logical `AND` operation.
|
1650
|
+
class SegmentDefinition
|
1651
|
+
include Google::Apis::Core::Hashable
|
1652
|
+
|
1653
|
+
# A segment is defined by a set of segment filters which are combined together
|
1654
|
+
# with a logical `AND` operation.
|
1655
|
+
# Corresponds to the JSON property `segmentFilters`
|
1656
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::SegmentFilter>]
|
1657
|
+
attr_accessor :segment_filters
|
1658
|
+
|
1659
|
+
def initialize(**args)
|
1660
|
+
update!(**args)
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
# Update properties of this object
|
1664
|
+
def update!(**args)
|
1665
|
+
@segment_filters = args[:segment_filters] if args.key?(:segment_filters)
|
1666
|
+
end
|
1667
|
+
end
|
1668
|
+
|
1669
|
+
# Dimension filter specifies the filtering options on a dimension.
|
1670
|
+
class SegmentDimensionFilter
|
1671
|
+
include Google::Apis::Core::Hashable
|
1672
|
+
|
1673
|
+
# Should the match be case sensitive, ignored for `IN_LIST` operator.
|
1674
|
+
# Corresponds to the JSON property `caseSensitive`
|
1675
|
+
# @return [Boolean]
|
1676
|
+
attr_accessor :case_sensitive
|
1677
|
+
alias_method :case_sensitive?, :case_sensitive
|
1678
|
+
|
1679
|
+
# Name of the dimension for which the filter is being applied.
|
1680
|
+
# Corresponds to the JSON property `dimensionName`
|
1681
|
+
# @return [String]
|
1682
|
+
attr_accessor :dimension_name
|
1683
|
+
|
1684
|
+
# The list of expressions, only the first element is used for all operators
|
1685
|
+
# Corresponds to the JSON property `expressions`
|
1686
|
+
# @return [Array<String>]
|
1687
|
+
attr_accessor :expressions
|
1688
|
+
|
1689
|
+
# Maximum comparison values for `BETWEEN` match type.
|
1690
|
+
# Corresponds to the JSON property `maxComparisonValue`
|
1691
|
+
# @return [String]
|
1692
|
+
attr_accessor :max_comparison_value
|
1693
|
+
|
1694
|
+
# Minimum comparison values for `BETWEEN` match type.
|
1695
|
+
# Corresponds to the JSON property `minComparisonValue`
|
1696
|
+
# @return [String]
|
1697
|
+
attr_accessor :min_comparison_value
|
1698
|
+
|
1699
|
+
# The operator to use to match the dimension with the expressions.
|
1700
|
+
# Corresponds to the JSON property `operator`
|
1701
|
+
# @return [String]
|
1702
|
+
attr_accessor :operator
|
1703
|
+
|
1704
|
+
def initialize(**args)
|
1705
|
+
update!(**args)
|
1706
|
+
end
|
1707
|
+
|
1708
|
+
# Update properties of this object
|
1709
|
+
def update!(**args)
|
1710
|
+
@case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
|
1711
|
+
@dimension_name = args[:dimension_name] if args.key?(:dimension_name)
|
1712
|
+
@expressions = args[:expressions] if args.key?(:expressions)
|
1713
|
+
@max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
|
1714
|
+
@min_comparison_value = args[:min_comparison_value] if args.key?(:min_comparison_value)
|
1715
|
+
@operator = args[:operator] if args.key?(:operator)
|
1716
|
+
end
|
1717
|
+
end
|
1718
|
+
|
1719
|
+
# SegmentFilter defines the segment to be either a simple or a sequence segment.
|
1720
|
+
# A simple segment condition contains dimension and metric conditions to select
|
1721
|
+
# the sessions or users. A sequence segment condition can be used to select
|
1722
|
+
# users or sessions based on sequential conditions.
|
1723
|
+
class SegmentFilter
|
1724
|
+
include Google::Apis::Core::Hashable
|
1725
|
+
|
1726
|
+
# If true, match the complement of simple or sequence segment. For example, to
|
1727
|
+
# match all visits not from "New York", we can define the segment as follows: "
|
1728
|
+
# sessionSegment": ` "segmentFilters": [` "simpleSegment" :` "
|
1729
|
+
# orFiltersForSegment": [` "segmentFilterClauses":[` "dimensionFilter": ` "
|
1730
|
+
# dimensionName": "ga:city", "expressions": ["New York"] ` `] `] `, "not": "True"
|
1731
|
+
# `] `,
|
1732
|
+
# Corresponds to the JSON property `not`
|
1733
|
+
# @return [Boolean]
|
1734
|
+
attr_accessor :not
|
1735
|
+
alias_method :not?, :not
|
1736
|
+
|
1737
|
+
# Sequence conditions consist of one or more steps, where each step is defined
|
1738
|
+
# by one or more dimension/metric conditions. Multiple steps can be combined
|
1739
|
+
# with special sequence operators.
|
1740
|
+
# Corresponds to the JSON property `sequenceSegment`
|
1741
|
+
# @return [Google::Apis::AnalyticsreportingV4::SequenceSegment]
|
1742
|
+
attr_accessor :sequence_segment
|
1743
|
+
|
1744
|
+
# A Simple segment conditions consist of one or more dimension/metric conditions
|
1745
|
+
# that can be combined.
|
1746
|
+
# Corresponds to the JSON property `simpleSegment`
|
1747
|
+
# @return [Google::Apis::AnalyticsreportingV4::SimpleSegment]
|
1748
|
+
attr_accessor :simple_segment
|
1749
|
+
|
1750
|
+
def initialize(**args)
|
1751
|
+
update!(**args)
|
1752
|
+
end
|
1753
|
+
|
1754
|
+
# Update properties of this object
|
1755
|
+
def update!(**args)
|
1756
|
+
@not = args[:not] if args.key?(:not)
|
1757
|
+
@sequence_segment = args[:sequence_segment] if args.key?(:sequence_segment)
|
1758
|
+
@simple_segment = args[:simple_segment] if args.key?(:simple_segment)
|
1759
|
+
end
|
1760
|
+
end
|
1761
|
+
|
1762
|
+
# Filter Clause to be used in a segment definition, can be wither a metric or a
|
1763
|
+
# dimension filter.
|
1764
|
+
class SegmentFilterClause
|
1765
|
+
include Google::Apis::Core::Hashable
|
1766
|
+
|
1767
|
+
# Dimension filter specifies the filtering options on a dimension.
|
1768
|
+
# Corresponds to the JSON property `dimensionFilter`
|
1769
|
+
# @return [Google::Apis::AnalyticsreportingV4::SegmentDimensionFilter]
|
1770
|
+
attr_accessor :dimension_filter
|
1771
|
+
|
1772
|
+
# Metric filter to be used in a segment filter clause.
|
1773
|
+
# Corresponds to the JSON property `metricFilter`
|
1774
|
+
# @return [Google::Apis::AnalyticsreportingV4::SegmentMetricFilter]
|
1775
|
+
attr_accessor :metric_filter
|
1776
|
+
|
1777
|
+
# Matches the complement (`!`) of the filter.
|
1778
|
+
# Corresponds to the JSON property `not`
|
1779
|
+
# @return [Boolean]
|
1780
|
+
attr_accessor :not
|
1781
|
+
alias_method :not?, :not
|
1782
|
+
|
1783
|
+
def initialize(**args)
|
1784
|
+
update!(**args)
|
1785
|
+
end
|
1786
|
+
|
1787
|
+
# Update properties of this object
|
1788
|
+
def update!(**args)
|
1789
|
+
@dimension_filter = args[:dimension_filter] if args.key?(:dimension_filter)
|
1790
|
+
@metric_filter = args[:metric_filter] if args.key?(:metric_filter)
|
1791
|
+
@not = args[:not] if args.key?(:not)
|
1792
|
+
end
|
1793
|
+
end
|
1794
|
+
|
1795
|
+
# Metric filter to be used in a segment filter clause.
|
1796
|
+
class SegmentMetricFilter
|
1797
|
+
include Google::Apis::Core::Hashable
|
1798
|
+
|
1799
|
+
# The value to compare against. If the operator is `BETWEEN`, this value is
|
1800
|
+
# treated as minimum comparison value.
|
1801
|
+
# Corresponds to the JSON property `comparisonValue`
|
1802
|
+
# @return [String]
|
1803
|
+
attr_accessor :comparison_value
|
1804
|
+
|
1805
|
+
# Max comparison value is only used for `BETWEEN` operator.
|
1806
|
+
# Corresponds to the JSON property `maxComparisonValue`
|
1807
|
+
# @return [String]
|
1808
|
+
attr_accessor :max_comparison_value
|
1809
|
+
|
1810
|
+
# The metric that will be filtered on. A `metricFilter` must contain a metric
|
1811
|
+
# name.
|
1812
|
+
# Corresponds to the JSON property `metricName`
|
1813
|
+
# @return [String]
|
1814
|
+
attr_accessor :metric_name
|
1815
|
+
|
1816
|
+
# Specifies is the operation to perform to compare the metric. The default is `
|
1817
|
+
# EQUAL`.
|
1818
|
+
# Corresponds to the JSON property `operator`
|
1819
|
+
# @return [String]
|
1820
|
+
attr_accessor :operator
|
1821
|
+
|
1822
|
+
# Scope for a metric defines the level at which that metric is defined. The
|
1823
|
+
# specified metric scope must be equal to or greater than its primary scope as
|
1824
|
+
# defined in the data model. The primary scope is defined by if the segment is
|
1825
|
+
# selecting users or sessions.
|
1826
|
+
# Corresponds to the JSON property `scope`
|
1827
|
+
# @return [String]
|
1828
|
+
attr_accessor :scope
|
1829
|
+
|
1830
|
+
def initialize(**args)
|
1831
|
+
update!(**args)
|
1832
|
+
end
|
1833
|
+
|
1834
|
+
# Update properties of this object
|
1835
|
+
def update!(**args)
|
1836
|
+
@comparison_value = args[:comparison_value] if args.key?(:comparison_value)
|
1837
|
+
@max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
|
1838
|
+
@metric_name = args[:metric_name] if args.key?(:metric_name)
|
1839
|
+
@operator = args[:operator] if args.key?(:operator)
|
1840
|
+
@scope = args[:scope] if args.key?(:scope)
|
1841
|
+
end
|
1842
|
+
end
|
1843
|
+
|
1844
|
+
# A segment sequence definition.
|
1845
|
+
class SegmentSequenceStep
|
1846
|
+
include Google::Apis::Core::Hashable
|
1847
|
+
|
1848
|
+
# Specifies if the step immediately precedes or can be any time before the next
|
1849
|
+
# step.
|
1850
|
+
# Corresponds to the JSON property `matchType`
|
1851
|
+
# @return [String]
|
1852
|
+
attr_accessor :match_type
|
1853
|
+
|
1854
|
+
# A sequence is specified with a list of Or grouped filters which are combined
|
1855
|
+
# with `AND` operator.
|
1856
|
+
# Corresponds to the JSON property `orFiltersForSegment`
|
1857
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
|
1858
|
+
attr_accessor :or_filters_for_segment
|
1859
|
+
|
1860
|
+
def initialize(**args)
|
1861
|
+
update!(**args)
|
1862
|
+
end
|
1863
|
+
|
1864
|
+
# Update properties of this object
|
1865
|
+
def update!(**args)
|
1866
|
+
@match_type = args[:match_type] if args.key?(:match_type)
|
1867
|
+
@or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
|
1868
|
+
end
|
1869
|
+
end
|
1870
|
+
|
1871
|
+
# Sequence conditions consist of one or more steps, where each step is defined
|
1872
|
+
# by one or more dimension/metric conditions. Multiple steps can be combined
|
1873
|
+
# with special sequence operators.
|
1874
|
+
class SequenceSegment
|
1875
|
+
include Google::Apis::Core::Hashable
|
1876
|
+
|
1877
|
+
# If set, first step condition must match the first hit of the visitor (in the
|
1878
|
+
# date range).
|
1879
|
+
# Corresponds to the JSON property `firstStepShouldMatchFirstHit`
|
1880
|
+
# @return [Boolean]
|
1881
|
+
attr_accessor :first_step_should_match_first_hit
|
1882
|
+
alias_method :first_step_should_match_first_hit?, :first_step_should_match_first_hit
|
1883
|
+
|
1884
|
+
# The list of steps in the sequence.
|
1885
|
+
# Corresponds to the JSON property `segmentSequenceSteps`
|
1886
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::SegmentSequenceStep>]
|
1887
|
+
attr_accessor :segment_sequence_steps
|
1888
|
+
|
1889
|
+
def initialize(**args)
|
1890
|
+
update!(**args)
|
1891
|
+
end
|
1892
|
+
|
1893
|
+
# Update properties of this object
|
1894
|
+
def update!(**args)
|
1895
|
+
@first_step_should_match_first_hit = args[:first_step_should_match_first_hit] if args.key?(:first_step_should_match_first_hit)
|
1896
|
+
@segment_sequence_steps = args[:segment_sequence_steps] if args.key?(:segment_sequence_steps)
|
1897
|
+
end
|
1898
|
+
end
|
1899
|
+
|
1900
|
+
# A Simple segment conditions consist of one or more dimension/metric conditions
|
1901
|
+
# that can be combined.
|
1902
|
+
class SimpleSegment
|
1903
|
+
include Google::Apis::Core::Hashable
|
1904
|
+
|
1905
|
+
# A list of segment filters groups which are combined with logical `AND`
|
1906
|
+
# operator.
|
1907
|
+
# Corresponds to the JSON property `orFiltersForSegment`
|
1908
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
|
1909
|
+
attr_accessor :or_filters_for_segment
|
1910
|
+
|
1911
|
+
def initialize(**args)
|
1912
|
+
update!(**args)
|
1913
|
+
end
|
1914
|
+
|
1915
|
+
# Update properties of this object
|
1916
|
+
def update!(**args)
|
1917
|
+
@or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
|
1918
|
+
end
|
1919
|
+
end
|
1920
|
+
|
1921
|
+
# Represents details collected when the visitor performs a transaction on the
|
1922
|
+
# page.
|
1923
|
+
class TransactionData
|
1924
|
+
include Google::Apis::Core::Hashable
|
1925
|
+
|
1926
|
+
# The transaction ID, supplied by the e-commerce tracking method, for the
|
1927
|
+
# purchase in the shopping cart.
|
1928
|
+
# Corresponds to the JSON property `transactionId`
|
1929
|
+
# @return [String]
|
1930
|
+
attr_accessor :transaction_id
|
1931
|
+
|
1932
|
+
# The total sale revenue (excluding shipping and tax) of the transaction.
|
1933
|
+
# Corresponds to the JSON property `transactionRevenue`
|
1934
|
+
# @return [Float]
|
1935
|
+
attr_accessor :transaction_revenue
|
1936
|
+
|
1937
|
+
# Total cost of shipping.
|
1938
|
+
# Corresponds to the JSON property `transactionShipping`
|
1939
|
+
# @return [Float]
|
1940
|
+
attr_accessor :transaction_shipping
|
1941
|
+
|
1942
|
+
# Total tax for the transaction.
|
1943
|
+
# Corresponds to the JSON property `transactionTax`
|
1944
|
+
# @return [Float]
|
1945
|
+
attr_accessor :transaction_tax
|
1946
|
+
|
1947
|
+
def initialize(**args)
|
1948
|
+
update!(**args)
|
1949
|
+
end
|
1950
|
+
|
1951
|
+
# Update properties of this object
|
1952
|
+
def update!(**args)
|
1953
|
+
@transaction_id = args[:transaction_id] if args.key?(:transaction_id)
|
1954
|
+
@transaction_revenue = args[:transaction_revenue] if args.key?(:transaction_revenue)
|
1955
|
+
@transaction_shipping = args[:transaction_shipping] if args.key?(:transaction_shipping)
|
1956
|
+
@transaction_tax = args[:transaction_tax] if args.key?(:transaction_tax)
|
1957
|
+
end
|
1958
|
+
end
|
1959
|
+
|
1960
|
+
# Contains information to identify a particular user uniquely.
|
1961
|
+
class User
|
1962
|
+
include Google::Apis::Core::Hashable
|
1963
|
+
|
1964
|
+
# Type of the user in the request. The field `userId` is associated with this
|
1965
|
+
# type.
|
1966
|
+
# Corresponds to the JSON property `type`
|
1967
|
+
# @return [String]
|
1968
|
+
attr_accessor :type
|
1969
|
+
|
1970
|
+
# Unique Id of the user for which the data is being requested.
|
1971
|
+
# Corresponds to the JSON property `userId`
|
1972
|
+
# @return [String]
|
1973
|
+
attr_accessor :user_id
|
1974
|
+
|
1975
|
+
def initialize(**args)
|
1976
|
+
update!(**args)
|
1977
|
+
end
|
1978
|
+
|
1979
|
+
# Update properties of this object
|
1980
|
+
def update!(**args)
|
1981
|
+
@type = args[:type] if args.key?(:type)
|
1982
|
+
@user_id = args[:user_id] if args.key?(:user_id)
|
1983
|
+
end
|
1984
|
+
end
|
1985
|
+
|
1986
|
+
# This represents a user session performed on a specific device at a certain
|
1987
|
+
# time over a period of time.
|
1988
|
+
class UserActivitySession
|
1989
|
+
include Google::Apis::Core::Hashable
|
1990
|
+
|
1991
|
+
# Represents a detailed view into each of the activity in this session.
|
1992
|
+
# Corresponds to the JSON property `activities`
|
1993
|
+
# @return [Array<Google::Apis::AnalyticsreportingV4::Activity>]
|
1994
|
+
attr_accessor :activities
|
1995
|
+
|
1996
|
+
# The data source of a hit. By default, hits sent from analytics.js are reported
|
1997
|
+
# as "web" and hits sent from the mobile SDKs are reported as "app". These
|
1998
|
+
# values can be overridden in the Measurement Protocol.
|
1999
|
+
# Corresponds to the JSON property `dataSource`
|
2000
|
+
# @return [String]
|
2001
|
+
attr_accessor :data_source
|
2002
|
+
|
2003
|
+
# The type of device used: "mobile", "tablet" etc.
|
2004
|
+
# Corresponds to the JSON property `deviceCategory`
|
2005
|
+
# @return [String]
|
2006
|
+
attr_accessor :device_category
|
2007
|
+
|
2008
|
+
# Platform on which the activity happened: "android", "ios" etc.
|
2009
|
+
# Corresponds to the JSON property `platform`
|
2010
|
+
# @return [String]
|
2011
|
+
attr_accessor :platform
|
2012
|
+
|
2013
|
+
# Date of this session in ISO-8601 format.
|
2014
|
+
# Corresponds to the JSON property `sessionDate`
|
2015
|
+
# @return [String]
|
2016
|
+
attr_accessor :session_date
|
2017
|
+
|
2018
|
+
# Unique ID of the session.
|
2019
|
+
# Corresponds to the JSON property `sessionId`
|
2020
|
+
# @return [String]
|
2021
|
+
attr_accessor :session_id
|
2022
|
+
|
2023
|
+
def initialize(**args)
|
2024
|
+
update!(**args)
|
2025
|
+
end
|
2026
|
+
|
2027
|
+
# Update properties of this object
|
2028
|
+
def update!(**args)
|
2029
|
+
@activities = args[:activities] if args.key?(:activities)
|
2030
|
+
@data_source = args[:data_source] if args.key?(:data_source)
|
2031
|
+
@device_category = args[:device_category] if args.key?(:device_category)
|
2032
|
+
@platform = args[:platform] if args.key?(:platform)
|
2033
|
+
@session_date = args[:session_date] if args.key?(:session_date)
|
2034
|
+
@session_id = args[:session_id] if args.key?(:session_id)
|
2035
|
+
end
|
2036
|
+
end
|
2037
|
+
end
|
2038
|
+
end
|
2039
|
+
end
|