ahoy_matey 3.0.1 → 3.0.2

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
  SHA256:
3
- metadata.gz: d90d64ae8641aa0bae1bc44acf29379a585ebbad0bbb87325380508d5a8ffcc7
4
- data.tar.gz: 7c01ce8cbd2e92e3555479b251889d171b54be9d5c369fca51f413fdc912ab01
3
+ metadata.gz: 0007d4286157e3456e73cd0fbcf9ac46905f7088caabd047f1514b4782a99432
4
+ data.tar.gz: 3b036aa183d4a847df7b1c42be88ce968cffaa3ce9b14281fc05abce747addcc
5
5
  SHA512:
6
- metadata.gz: fe62cce407d17f736b616f11a742fefe338cdedd2457665cb3e578bafe0bd6fbb889dd315382dcb70d563a35dd5c5e05de908c069e12d21ab92e0cee637e42d7
7
- data.tar.gz: f399c7708f6c1071c72db3d9164ab77bd3377fdc0eab7064707fb1202b240156be03669070763bf2f13bcf0bfcac134286eb9e9f9fb988d78267c71da9603386
6
+ metadata.gz: 6f74414728cdd0325ebe091894cc3300bfb889cd978cc15491c244682ca73c26294ce32585f9e91613bb69516eb80a867b7f968e249e4492beea3f83f298de6f
7
+ data.tar.gz: 927cc957710268438b2b01379fe4f58f5f43840f465033cbac200b183396da14391fe4f90121781cd1c34fa574b1fa09987434259fe71f43c484c6b56ede9512
@@ -1,11 +1,15 @@
1
- ## 3.0.1
1
+ ## 3.0.2 (2020-04-03)
2
+
3
+ - Added `cookie_options`
4
+
5
+ ## 3.0.1 (2019-09-21)
2
6
 
3
7
  - Made `Ahoy::Tracker` work outside of requests
4
8
  - Fixed storage of `false` values with customized store
5
9
  - Fixed error with `user_method` and `Rails::InfoController`
6
10
  - Gracefully handle `ActionDispatch::RemoteIp::IpSpoofAttackError`
7
11
 
8
- ## 3.0.0
12
+ ## 3.0.0 (2019-05-29)
9
13
 
10
14
  - Made Device Detector the default user agent parser
11
15
  - Made v2 the default bot detection version
@@ -13,18 +17,18 @@
13
17
  - Removed search keyword detection (most search engines today prevent this)
14
18
  - Removed support for Rails < 5
15
19
 
16
- ## 2.2.1
20
+ ## 2.2.1 (2019-05-26)
17
21
 
18
22
  - Updated Ahoy.js to 0.3.4
19
23
  - Fixed v2 bot detection
20
24
  - Added latitude and longitude to installation
21
25
 
22
- ## 2.2.0
26
+ ## 2.2.0 (2019-01-04)
23
27
 
24
28
  - Added `amp_event` helper
25
29
  - Improved bot detection for Device Detector
26
30
 
27
- ## 2.1.0
31
+ ## 2.1.0 (2018-05-18)
28
32
 
29
33
  - Added option for IP masking
30
34
  - Added option to use anonymity sets instead of cookies
@@ -32,19 +36,19 @@
32
36
  - Fixed `visitable` for Rails 4.2
33
37
  - Removed `search_keyword` from new installs
34
38
 
35
- ## 2.0.2
39
+ ## 2.0.2 (2018-03-14)
36
40
 
37
41
  - Fixed error on duplicate records
38
42
  - Fixed message when visit not found for geocoding
39
43
  - Better compatibility with GeoLite2
40
44
  - Better browser compatibility for Ahoy.js
41
45
 
42
- ## 2.0.1
46
+ ## 2.0.1 (2018-02-26)
43
47
 
44
48
  - Added `Ahoy.server_side_visits = :when_needed` to automatically create visits server-side when needed for events and `visitable`
45
49
  - Better handling of visit duration and expiration in JavaScript
46
50
 
47
- ## 2.0.0
51
+ ## 2.0.0 (2018-02-25)
48
52
 
49
53
  - Removed dependency on jQuery
50
54
  - Use `navigator.sendBeacon` by default in supported browsers
@@ -66,58 +70,58 @@ Breaking changes
66
70
  - Removed most built-in stores
67
71
  - Removed support for Rails < 4.2
68
72
 
69
- ## 1.6.1
73
+ ## 1.6.1 (2018-02-02)
70
74
 
71
75
  - Added `gin` index on properties for events
72
76
  - Fixed `visitable` options when name not provided
73
77
 
74
- ## 1.6.0
78
+ ## 1.6.0 (2017-05-01)
75
79
 
76
80
  - Added support for Rails 5.1
77
81
 
78
- ## 1.5.5
82
+ ## 1.5.5 (2017-03-23)
79
83
 
80
84
  - Added support for Rails API
81
85
  - Added NATS and NSQ stores
82
86
 
83
- ## 1.5.4
87
+ ## 1.5.4 (2017-01-22)
84
88
 
85
89
  - Fixed issue with duplicate events
86
90
  - Added support for PostGIS for `where_properties`
87
91
 
88
- ## 1.5.3
92
+ ## 1.5.3 (2016-10-31)
89
93
 
90
94
  - Fixed error with Rails 5 and Mongoid 6
91
95
  - Fixed regression with server not generating visit and visitor tokens
92
96
  - Accept UTM parameters as request parameters (for native apps)
93
97
 
94
- ## 1.5.2
98
+ ## 1.5.2 (2016-08-26)
95
99
 
96
100
  - Better support for Rails 5
97
101
 
98
- ## 1.5.1
102
+ ## 1.5.1 (2016-08-19)
99
103
 
100
104
  - Restored throttling after removing side effects
101
105
 
102
- ## 1.5.0
106
+ ## 1.5.0 (2016-08-19)
103
107
 
104
108
  - Removed throttling due to unintended side effects with its implementation
105
109
  - Ensure basic token requirements
106
110
  - Fixed visit recreation on cookie expiration
107
111
  - Fixed issue where `/ahoy/visits` is called indefinitely when `Ahoy.cookie_domain = :all`
108
112
 
109
- ## 1.4.2
113
+ ## 1.4.2 (2016-06-21)
110
114
 
111
115
  - Fixed issues with `where_properties`
112
116
 
113
- ## 1.4.1
117
+ ## 1.4.1 (2016-06-20)
114
118
 
115
119
  - Added `where_properties` method
116
120
  - Added Kafka store
117
121
  - Added `mount` option
118
122
  - Use less intrusive version of `safely`
119
123
 
120
- ## 1.4.0
124
+ ## 1.4.0 (2016-03-23)
121
125
 
122
126
  - Use `ActiveRecordTokenStore` by default (integer instead of uuid for id)
123
127
  - Detect database for `rails g ahoy:stores:active_record` for easier installation
@@ -125,55 +129,55 @@ Breaking changes
125
129
  - Fixed issue with log silencer
126
130
  - Use multi-column indexes on `ahoy_events` table creation
127
131
 
128
- ## 1.3.1
132
+ ## 1.3.1 (2016-03-22)
129
133
 
130
134
  - Raise errors in test environment
131
135
 
132
- ## 1.3.0
136
+ ## 1.3.0 (2016-03-06)
133
137
 
134
138
  - Added throttling
135
139
  - Added `max_content_length` and `max_events_per_request`
136
140
 
137
- ## 1.2.2
141
+ ## 1.2.2 (2016-03-05)
138
142
 
139
143
  - Fixed issue with latest version of `browser` gem
140
144
  - Added support for RabbitMQ
141
145
  - Added support for Amazon Kinesis Firehose
142
146
  - Fixed deprecation warnings in Rails 5
143
147
 
144
- ## 1.2.1
148
+ ## 1.2.1 (2015-08-14)
145
149
 
146
150
  - Fixed `SystemStackError: stack level too deep` when used with `activerecord-session_store`
147
151
 
148
- ## 1.2.0
152
+ ## 1.2.0 (2015-06-07)
149
153
 
150
154
  - Added support for PostgreSQL `jsonb` column type
151
155
  - Added Fluentd store
152
156
  - Added latitude, longitude, and postal_code to visits
153
157
  - Log exclusions
154
158
 
155
- ## 1.1.1
159
+ ## 1.1.1 (2015-01-05)
156
160
 
157
161
  - Better support for Authlogic
158
162
  - Added `screen_height` and `screen_width`
159
163
 
160
- ## 1.1.0
164
+ ## 1.1.0 (2014-11-02)
161
165
 
162
166
  - Added `geocode` option
163
167
  - Report errors to service by default
164
168
  - Fixed association mismatch
165
169
 
166
- ## 1.0.2
170
+ ## 1.0.2 (2014-07-10)
167
171
 
168
172
  - Fixed BSON for Mongoid 3
169
173
  - Fixed Doorkeeper integration
170
174
  - Fixed user tracking in overridden authenticate method
171
175
 
172
- ## 1.0.1
176
+ ## 1.0.1 (2014-06-27)
173
177
 
174
178
  - Fixed `visitable` outside of requests
175
179
 
176
- ## 1.0.0
180
+ ## 1.0.0 (2014-06-18)
177
181
 
178
182
  - Added support for any data store, and Mongoid out of the box
179
183
  - Added `track_visits_immediately` option
@@ -181,17 +185,17 @@ Breaking changes
181
185
  - Visits expire after inactivity, not fixed interval
182
186
  - Added `visit_duration` and `visitor_duration` options
183
187
 
184
- ## 0.3.2
188
+ ## 0.3.2 (2014-06-15)
185
189
 
186
190
  - Fixed bot exclusion for visits
187
191
  - Fixed user method
188
192
 
189
- ## 0.3.1
193
+ ## 0.3.1 (2014-06-12)
190
194
 
191
195
  - Fixed visitor cookies when set on server
192
196
  - Added `domain` option for server cookies
193
197
 
194
- ## 0.3.0
198
+ ## 0.3.0 (2014-06-11)
195
199
 
196
200
  - Added `current_visit_token` and `current_visitor_token` method
197
201
  - Switched to UUIDs
@@ -199,47 +203,47 @@ Breaking changes
199
203
  - Skip server-side bot events
200
204
  - Added `request` argument to `exclude_method`
201
205
 
202
- ## 0.2.2
206
+ ## 0.2.2 (2014-05-26)
203
207
 
204
208
  - Added `exclude_method` option
205
209
  - Added support for batch events
206
210
  - Fixed cookie encoding
207
211
  - Fixed `options` variable from being modified
208
212
 
209
- ## 0.2.1
213
+ ## 0.2.1 (2014-05-16)
210
214
 
211
215
  - Fixed IE 8 error
212
216
  - Added `track_bots` option
213
217
  - Added `$authenticate` event
214
218
 
215
- ## 0.2.0
219
+ ## 0.2.0 (2014-05-13)
216
220
 
217
221
  - Added event tracking (merged ahoy_events)
218
222
  - Added ahoy.js
219
223
 
220
- ## 0.1.8
224
+ ## 0.1.8 (2014-05-11)
221
225
 
222
226
  - Fixed bug with `user_type` set to `false` instead of `nil`
223
227
 
224
- ## 0.1.7
228
+ ## 0.1.7 (2014-05-11)
225
229
 
226
230
  - Made cookie functions public for ahoy_events
227
231
 
228
- ## 0.1.6
232
+ ## 0.1.6 (2014-05-07)
229
233
 
230
234
  - Better user agent parser
231
235
 
232
- ## 0.1.5
236
+ ## 0.1.5 (2014-05-01)
233
237
 
234
238
  - Added support for Doorkeeper
235
239
  - Added options to `visitable`
236
240
  - Added `landing_params` method
237
241
 
238
- ## 0.1.4
242
+ ## 0.1.4 (2014-04-27)
239
243
 
240
244
  - Added `ahoy.ready()` and `ahoy.log()` for events
241
245
 
242
- ## 0.1.3
246
+ ## 0.1.3 (2014-04-24)
243
247
 
244
248
  - Supports `current_user` from `ApplicationController`
245
249
  - Added `ahoy.reset()`
@@ -247,16 +251,16 @@ Breaking changes
247
251
  - Added experimental support for native apps
248
252
  - Prefer `ahoy` over `Ahoy`
249
253
 
250
- ## 0.1.2
254
+ ## 0.1.2 (2014-04-15)
251
255
 
252
256
  - Attach user on Devise sign up
253
257
  - Ability to specify visit model
254
258
 
255
- ## 0.1.1
259
+ ## 0.1.1 (2014-03-20)
256
260
 
257
261
  - Made most database columns optional
258
262
  - Performance hack for referer-parser
259
263
 
260
- ## 0.1.0
264
+ ## 0.1.0 (2014-03-19)
261
265
 
262
266
  - First major release
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Ahoy
2
2
 
3
- :fire: Simple, powerful analytics for Rails
3
+ :fire: Simple, powerful, first-party analytics for Rails
4
4
 
5
5
  Track visits and events in Ruby, JavaScript, and native apps. Data is stored in your database by default so you can easily combine it with other data.
6
6
 
7
- :postbox: To track emails, check out [Ahoy Email](https://github.com/ankane/ahoy_email), and for A/B testing, check out [Field Test](https://github.com/ankane/field_test)
7
+ :postbox: Check out [Ahoy Email](https://github.com/ankane/ahoy_email) for emails and [Field Test](https://github.com/ankane/field_test) for A/B testing
8
8
 
9
9
  :tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
10
10
 
@@ -292,7 +292,7 @@ By default, a new visit is created after 4 hours of inactivity. Change this with
292
292
  Ahoy.visit_duration = 30.minutes
293
293
  ```
294
294
 
295
- ### Multiple Subdomains
295
+ ### Cookies
296
296
 
297
297
  To track visits across multiple subdomains, use:
298
298
 
@@ -300,6 +300,12 @@ To track visits across multiple subdomains, use:
300
300
  Ahoy.cookie_domain = :all
301
301
  ```
302
302
 
303
+ Set other [cookie options](https://api.rubyonrails.org/classes/ActionDispatch/Cookies.html) with:
304
+
305
+ ```ruby
306
+ Ahoy.cookie_options = {same_site: :lax}
307
+ ```
308
+
303
309
  ### Geocoding
304
310
 
305
311
  Disable geocoding with:
@@ -308,7 +314,7 @@ Disable geocoding with:
308
314
  Ahoy.geocode = false
309
315
  ```
310
316
 
311
- Change the job queue with:
317
+ The default job queue is `:ahoy`. Change this with:
312
318
 
313
319
  ```ruby
314
320
  Ahoy.job_queue = :low_priority
@@ -30,8 +30,12 @@ module Ahoy
30
30
  mattr_accessor :cookies
31
31
  self.cookies = true
32
32
 
33
+ # TODO deprecate in favor of cookie_options
33
34
  mattr_accessor :cookie_domain
34
35
 
36
+ mattr_accessor :cookie_options
37
+ self.cookie_options = {}
38
+
35
39
  mattr_accessor :server_side_visits
36
40
  self.server_side_visits = true
37
41
 
@@ -171,12 +171,11 @@ module Ahoy
171
171
  # safety net
172
172
  return unless Ahoy.cookies && request
173
173
 
174
- cookie = {
175
- value: value
176
- }
174
+ cookie = Ahoy.cookie_options.merge(value: value)
177
175
  cookie[:expires] = duration.from_now if duration
178
- domain = Ahoy.cookie_domain
179
- cookie[:domain] = domain if domain && use_domain
176
+ # prefer cookie_options[:domain] over cookie_domain
177
+ cookie[:domain] ||= Ahoy.cookie_domain if Ahoy.cookie_domain
178
+ cookie.delete(:domain) unless use_domain
180
179
  request.cookie_jar[name] = cookie
181
180
  end
182
181
 
@@ -1,3 +1,3 @@
1
1
  module Ahoy
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_matey
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2020-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -253,8 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
- rubygems_version: 3.0.3
256
+ rubygems_version: 3.1.2
257
257
  signing_key:
258
258
  specification_version: 4
259
- summary: Simple, powerful analytics for Rails
259
+ summary: Simple, powerful, first-party analytics for Rails
260
260
  test_files: []