mbuzz 0.10.0 → 0.10.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 +4 -4
- data/CHANGELOG.md +19 -0
- data/lib/mbuzz/client/session_request.rb +11 -2
- data/lib/mbuzz/client.rb +4 -2
- data/lib/mbuzz/middleware/session_endpoint.rb +2 -1
- data/lib/mbuzz/middleware/tracking.rb +2 -1
- data/lib/mbuzz/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71d8b00de3facb7fd1290c03f1493edf09586333ad6ea44e1de03ebba375805f
|
|
4
|
+
data.tar.gz: 69eac0945b4b2630038753770fd398154cc1d407e15e9e8ff0d1770fb53bf95d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f0a99184a1860342c7088c1642495d11db115ecbd7571bfffd6f29ea8fc770d6d0ea3d473f1ae7a6681eadb19d8b387ce86968df369d5e785301a1f157b2ad3
|
|
7
|
+
data.tar.gz: 3ba3d4419fa579e5840a46e398202637f4d7f5b119fbc2815b1cac5db1504f4d0f69a5d68481ad1075bb875d42e0121aa9f06696bf9cc9a254accb9c7a1a0aab
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.10.1] - 2026-09-17
|
|
9
|
+
|
|
10
|
+
### Fixed — the visitor's IP now reaches mbuzz on session create
|
|
11
|
+
|
|
12
|
+
- **`POST /api/v1/sessions` now carries `ip`.** The middleware already extracted the visitor's
|
|
13
|
+
address — it is half of `device_fingerprint = SHA256(ip|user_agent)` — and then dropped it at
|
|
14
|
+
three points on the way out: `Client.session` had no `ip:` keyword, `SessionRequest#payload`
|
|
15
|
+
omitted it, and `Middleware::Tracking`'s own call site omitted it too. Events and conversions have
|
|
16
|
+
always sent one; only sessions did not.
|
|
17
|
+
- **Why it matters.** mbuzz sends Meta's Conversions API `client_ip_address`, which Meta documents
|
|
18
|
+
as **required** for website events, and a session with no address means the events resolved
|
|
19
|
+
through it carry none either. Upgrading improves Event Match Quality for anyone using conversion
|
|
20
|
+
feedback; it changes nothing else.
|
|
21
|
+
- **No API change.** `ip:` is an optional keyword on `Client.session` and both middlewares fill it
|
|
22
|
+
automatically. Existing callers need no edit.
|
|
23
|
+
|
|
24
|
+
Found by the SDK integration harness rather than by unit tests: every layer was correct on its own,
|
|
25
|
+
and only a real request through a real app could tell the visitor's address from the app server's.
|
|
26
|
+
|
|
8
27
|
## [0.10.0] - 2026-09-08
|
|
9
28
|
|
|
10
29
|
### BREAKING — the page snippet is now required
|
|
@@ -12,7 +12,8 @@ module Mbuzz
|
|
|
12
12
|
# Response values
|
|
13
13
|
ACCEPTED_STATUS = "accepted"
|
|
14
14
|
|
|
15
|
-
def initialize(visitor_id:, session_id:, url:, referrer: nil, device_fingerprint: nil,
|
|
15
|
+
def initialize(visitor_id:, session_id:, url:, referrer: nil, device_fingerprint: nil,
|
|
16
|
+
user_agent: nil, started_at: nil, ip: nil)
|
|
16
17
|
@visitor_id = visitor_id
|
|
17
18
|
@session_id = session_id
|
|
18
19
|
@url = url
|
|
@@ -20,6 +21,7 @@ module Mbuzz
|
|
|
20
21
|
@device_fingerprint = device_fingerprint
|
|
21
22
|
@user_agent = user_agent
|
|
22
23
|
@started_at = started_at
|
|
24
|
+
@ip = ip
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
def call
|
|
@@ -32,7 +34,8 @@ module Mbuzz
|
|
|
32
34
|
|
|
33
35
|
private
|
|
34
36
|
|
|
35
|
-
attr_reader :visitor_id, :session_id, :url, :referrer, :device_fingerprint, :user_agent,
|
|
37
|
+
attr_reader :visitor_id, :session_id, :url, :referrer, :device_fingerprint, :user_agent,
|
|
38
|
+
:started_at, :ip
|
|
36
39
|
|
|
37
40
|
def valid?
|
|
38
41
|
present?(visitor_id) && present?(session_id) && present?(url)
|
|
@@ -42,6 +45,11 @@ module Mbuzz
|
|
|
42
45
|
@response ||= Api.post_with_response(SESSIONS_PATH, { session: payload })
|
|
43
46
|
end
|
|
44
47
|
|
|
48
|
+
# `ip` is the visitor's address, which the middleware already extracted to
|
|
49
|
+
# compute `device_fingerprint` (SHA256(ip|user_agent)). It was computed
|
|
50
|
+
# and then dropped here until 2026-09-17: mbuzz needs it for Meta's
|
|
51
|
+
# `client_ip_address`, which Meta documents as required for website
|
|
52
|
+
# events, and the events/conversions payloads have always carried it.
|
|
45
53
|
def payload
|
|
46
54
|
{
|
|
47
55
|
visitor_id: visitor_id,
|
|
@@ -50,6 +58,7 @@ module Mbuzz
|
|
|
50
58
|
referrer: referrer,
|
|
51
59
|
device_fingerprint: device_fingerprint,
|
|
52
60
|
user_agent: user_agent,
|
|
61
|
+
ip: ip,
|
|
53
62
|
started_at: started_at || Time.now.utc.iso8601
|
|
54
63
|
}.compact
|
|
55
64
|
end
|
data/lib/mbuzz/client.rb
CHANGED
|
@@ -32,7 +32,8 @@ module Mbuzz
|
|
|
32
32
|
).call
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def self.session(visitor_id:, session_id:, url:, referrer: nil, device_fingerprint: nil,
|
|
35
|
+
def self.session(visitor_id:, session_id:, url:, referrer: nil, device_fingerprint: nil,
|
|
36
|
+
user_agent: nil, started_at: nil, ip: nil)
|
|
36
37
|
SessionRequest.new(
|
|
37
38
|
visitor_id: visitor_id,
|
|
38
39
|
session_id: session_id,
|
|
@@ -40,7 +41,8 @@ module Mbuzz
|
|
|
40
41
|
referrer: referrer,
|
|
41
42
|
device_fingerprint: device_fingerprint,
|
|
42
43
|
user_agent: user_agent,
|
|
43
|
-
started_at: started_at
|
|
44
|
+
started_at: started_at,
|
|
45
|
+
ip: ip
|
|
44
46
|
).call
|
|
45
47
|
end
|
|
46
48
|
end
|
|
@@ -93,7 +93,8 @@ module Mbuzz
|
|
|
93
93
|
url: context[:url],
|
|
94
94
|
referrer: context[:referrer],
|
|
95
95
|
device_fingerprint: context[:device_fingerprint],
|
|
96
|
-
user_agent: context[:user_agent]
|
|
96
|
+
user_agent: context[:user_agent],
|
|
97
|
+
ip: context[:ip]
|
|
97
98
|
)
|
|
98
99
|
rescue StandardError => e
|
|
99
100
|
log_error("Session creation failed: #{e.message}") if Mbuzz.config.debug
|
data/lib/mbuzz/version.rb
CHANGED