ga_measurement_protocol 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa2ec550257a059832b803fcbc1ee008cf84fc35
4
- data.tar.gz: f0b85d781a4be8bd24c65d565ebc8e58b79038a3
3
+ metadata.gz: 3fbcd857f2830aaf4be7d4b351c3f2f52fc5c29c
4
+ data.tar.gz: 314cb2cf9aff35aef7166119ce65e24f339e7122
5
5
  SHA512:
6
- metadata.gz: 89cc00611a8bf8620f147e5080320bdcdd3e1d3eec4c0cb0fa3efca713e14cf56dcd0606142698c91f231ae56ba1d8413d32031683250bc7fa111d0ee4c9b0b4
7
- data.tar.gz: 5cc5be614e8c3167165242e65558c2e8c8bfd9b3153aef6c9e7c2a6a7c43b93d981c7e934ae87785793686d8334897b9c827b08912bae9ece6ccddf0c065ab42
6
+ metadata.gz: af63de2d0be4effbfcb844e11ed54cb47adba306dd31b9d68803979be98a2d8590aeefdf9e4b8e40c69d473d687aabf5ab35decba776d3fa24b9f2fe54af42c3
7
+ data.tar.gz: 0cb69f15daed60e9dede4957201ec19b307a3f68455adda5b99c19c4d894026841077c9800d94acda5438e0c8bbeaa7a9ed4c26a9c8a8ba17d85b691d9efec49
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # GaMeasurementProtocol
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ga_measurement_protocol`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Api client for Google Analytics Measurement Protocol in Ruby
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Measurement Protocol の概要  |  アナリティクス Measurement Protocol  |  Google Developers
6
+ https://developers.google.com/analytics/devguides/collection/protocol/v1/?hl=ja
6
7
 
7
8
  ## Installation
8
9
 
@@ -6,7 +6,8 @@ module GaMeasurementProtocol
6
6
  # Your code goes here...
7
7
  class Client
8
8
  attr_reader :conn
9
- def initialize
9
+ def initialize(debug: false)
10
+ @debug = debug
10
11
  url =
11
12
  'https://www.google-analytics.com'
12
13
 
@@ -18,7 +19,16 @@ module GaMeasurementProtocol
18
19
  end
19
20
 
20
21
  def post(request)
21
- JSON.parse(conn.post('/debug/collect', request).body)
22
+ url = if debug?
23
+ '/debug/collect'
24
+ else
25
+ '/collect'
26
+ end
27
+ JSON.parse(conn.post(url, request).body)
28
+ end
29
+
30
+ def debug?
31
+ @debug
22
32
  end
23
33
  end
24
34
  end
@@ -1,3 +1,3 @@
1
1
  module GaMeasurementProtocol
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ga_measurement_protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naofumi Fujii