google_analytics_v4_api 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fd25276f1134caa2c15a03bdc8d7ff73ee3618f34472e83c833d4836133addb
|
4
|
+
data.tar.gz: cd4acfef6b9d6a46c636c67b5b1044994c8a6748fc92e7431065d9e2b30c0bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9e129711c9ecfca29700c423651d5c72b97aa1c949c4b85d766cccd967dfda193a520b23554dce54209027d289fc3ff03d04f0276726a139b4c5ad62e18ce8c
|
7
|
+
data.tar.gz: e4c180466aab69ebf51ebeee5f9042335b16a7bf9a8fc97ebc289a88b3f9a37351ebac879c31a7bcfb3d95d4027e207639fe830708f22770e5bbdbf6d4dfa113
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "json"
|
4
4
|
|
5
5
|
module GoogleAnalyticsV4Api
|
6
6
|
class Property
|
7
|
-
attr_accessor :name, :propertyType, :createTime, :updateTime, :parent, :displayName, :industryCategory, :timeZone, :currencyCode, :serviceLevel, :deleteTime, :expireTime
|
7
|
+
attr_accessor :name, :propertyType, :createTime, :updateTime, :parent, :displayName, :industryCategory, :timeZone, :currencyCode, :serviceLevel, :deleteTime, :expireTime
|
8
8
|
|
9
9
|
def initialize(client, attributes = {})
|
10
10
|
@client = client
|
11
11
|
attributes.each do |k, v|
|
12
|
-
|
12
|
+
send("#{k}=", v) if self.respond_to?("#{k}=")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -35,4 +35,4 @@ module GoogleAnalyticsV4Api
|
|
35
35
|
GoogleAnalyticsV4Api::Property.new(client, JSON.parse(body))
|
36
36
|
end
|
37
37
|
end
|
38
|
-
end
|
38
|
+
end
|
@@ -7,11 +7,13 @@ module GoogleAnalyticsV4Api
|
|
7
7
|
class Report
|
8
8
|
attr_accessor :date_ranges, :dimensions, :metrics, :dimension_filter
|
9
9
|
|
10
|
-
def initialize(start_date: nil, end_date: nil, dimensions: [], metrics: [], dimension_filter: {})
|
10
|
+
def initialize(start_date: nil, end_date: nil, dimensions: [], metrics: [], dimension_filter: {}, limit: 20, offset: 0)
|
11
11
|
@date_ranges = [{ "startDate": start_date || (Date.today - 30), "endDate": end_date || Date.today }]
|
12
|
-
@dimensions
|
12
|
+
@dimensions = dimensions.map { |dimension| { "name": dimension } }
|
13
13
|
@metrics = metrics.map { |metric| { "name": metric } }
|
14
14
|
@dimension_filter = dimension_filter
|
15
|
+
@limit = limit
|
16
|
+
@offset = offset
|
15
17
|
end
|
16
18
|
|
17
19
|
def to_json
|
@@ -20,6 +22,8 @@ module GoogleAnalyticsV4Api
|
|
20
22
|
output[:dimensions] = @dimensions if !@dimensions.nil? && @dimensions.any?
|
21
23
|
output[:metrics] = @metrics if !@metrics.nil? && @metrics.any?
|
22
24
|
output[:dimensionFilter] = @dimension_filter if !@dimension_filter.nil? && @dimension_filter.any?
|
25
|
+
output[:limit] = @limit unless @limit.nil?
|
26
|
+
output[:offset] = @offset unless @offset.nil?
|
23
27
|
output.to_json
|
24
28
|
end
|
25
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_analytics_v4_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A very humble wrapper for the Google Analytics V4 API to be used in conjuntion
|
14
14
|
with OAuth2
|