oursprivacy-ingest 2.1.0 → 2.2.0

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: 3767105dbac8ee15778f0c235394576a7ef00b40a385acf516311e517e2ecb0c
4
- data.tar.gz: 20a9b6e80125289e1d57a52c9b5ca65095603899abacce6af4a1656e7c87572e
3
+ metadata.gz: 2c4d1cc55798cb8aab14d942c27d78bddcf464d077a66c0c24bbeebadc8b9561
4
+ data.tar.gz: 5050b5640a49552956b48ed4f86fb747f60cd9a92e7298f526096d5db995b2f3
5
5
  SHA512:
6
- metadata.gz: f35c01f70e5a44a414b6c0f6ff3952d567bdd13c16c1f913c2c8cde6348ed3f4c0659fc74cd3f113103d75e36b0fadb2bfcbca93fd31d2d453f122a8fb499087
7
- data.tar.gz: 06dca080636d4f55e38c514fda48eb9baf95213a14c77930f981ccee1f161116e3bf1c55184f9ee1474993060731f6fc152e4e72311631c26063181e19b15d9f
6
+ metadata.gz: fa0b484a89cd745edccb6855f6d85baa549b73fda113f6ced1b1dddeb6a9a1b0c074d95301ce6ff1d8405331d9fa9edfb5b1343c6c84810bbab6d8466f3cd871
7
+ data.tar.gz: d12d4a583d361a46248229781be853914e55adaa14d8934763d13bd1b316a06248f9bab0a369f6776edeb3c3d37d04937498d881b7bb19b8055342469e55f3a3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.0 (2026-11-10)
4
+
5
+ Full Changelog: [v2.1.0...v2.2.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v2.1.0...v2.2.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** API update.
3
10
  ## 2.1.0 (2026-11-05)
4
11
 
5
12
  Full Changelog: [v2.0.1...v2.1.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v2.0.1...v2.1.0)
data/README.md CHANGED
@@ -19,7 +19,7 @@ To use this gem, install via Bundler by adding the following to your application
19
19
  <!-- x-release-please-start-version -->
20
20
 
21
21
  ```ruby
22
- gem "oursprivacy-ingest", "~> 2.1.0"
22
+ gem "oursprivacy-ingest", "~> 2.2.0"
23
23
  ```
24
24
 
25
25
  <!-- x-release-please-end -->
@@ -60,7 +60,7 @@ module OursprivacyIngest
60
60
  nil?: true
61
61
 
62
62
  # @!attribute email
63
- # The email address of a user. When userId is absent and externalId does not
63
+ # The email address of a user. When visitorId is absent and externalId does not
64
64
  # resolve a visitor, we search your account for a visitor with this email. If no
65
65
  # match is found, we try userProperties.phone_number before creating a new
66
66
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -86,11 +86,11 @@ module OursprivacyIngest
86
86
  nil?: true
87
87
 
88
88
  # @!attribute external_id
89
- # Your system's unique identifier for this user. When userId is absent, we search
90
- # your account for an existing visitor with this externalId. If no match is found,
91
- # we try email and then userProperties.phone_number before creating a new visitor.
92
- # If you also have the userId from cookies or local storage, send both — it
93
- # removes the lookup round-trip. Non-string input is converted to text before
89
+ # Your system's unique identifier for this user. When visitorId is absent, we
90
+ # search your account for an existing visitor with this externalId. If no match is
91
+ # found, we try email and then userProperties.phone_number before creating a new
92
+ # visitor. If you also have the visitorId from cookies or local storage, send both
93
+ # — it removes the lookup round-trip. Non-string input is converted to text before
94
94
  # validation; clients should send a string. Leading and trailing whitespace is
95
95
  # removed before validation.
96
96
  #
@@ -117,11 +117,14 @@ module OursprivacyIngest
117
117
  optional :time, Float, nil?: true
118
118
 
119
119
  # @!attribute user_id
120
+ # @deprecated
121
+ #
120
122
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
121
123
  # When present, this is used directly — no lookup by externalId, email, or phone
122
- # is performed. If you have both a userId and an externalId, send both so the
123
- # event is attached to the right visitor without any lookup overhead. Leading and
124
- # trailing whitespace is removed before validation.
124
+ # is performed. If you have both a visitorId and an externalId, send both so the
125
+ # event is attached to the right visitor without any lookup overhead. visitorId
126
+ # takes precedence over the deprecated userId alias. Leading and trailing
127
+ # whitespace is removed before validation.
125
128
  #
126
129
  # @return [String, nil]
127
130
  optional :user_id, String, api_name: :userId, nil?: true
@@ -136,7 +139,18 @@ module OursprivacyIngest
136
139
  api_name: :userProperties,
137
140
  nil?: true
138
141
 
139
- # @!method initialize(distinct_id:, event:, default_properties: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil)
142
+ # @!attribute visitor_id
143
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
144
+ # When present, this is used directly — no lookup by externalId, email, or phone
145
+ # is performed. If you have both a visitorId and an externalId, send both so the
146
+ # event is attached to the right visitor without any lookup overhead. visitorId
147
+ # takes precedence over the deprecated userId alias. Leading and trailing
148
+ # whitespace is removed before validation.
149
+ #
150
+ # @return [String, nil]
151
+ optional :visitor_id, String, api_name: :visitorId, nil?: true
152
+
153
+ # @!method initialize(distinct_id:, event:, default_properties: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil, visitor_id: nil)
140
154
  # Some parameter documentations has been truncated, see
141
155
  # {OursprivacyIngest::Models::BatchCreateParams::Event} for more details.
142
156
  #
@@ -146,11 +160,11 @@ module OursprivacyIngest
146
160
  #
147
161
  # @param default_properties [OursprivacyIngest::Models::BatchCreateParams::Event::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
148
162
  #
149
- # @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
163
+ # @param email [String, nil] The email address of a user. When visitorId is absent and externalId does not re
150
164
  #
151
165
  # @param event_properties [Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, nil}, nil}, nil}, nil}, nil}, nil] Any additional event properties you want to pass along. Use at most 200 nonempty
152
166
  #
153
- # @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
167
+ # @param external_id [String, nil] Your system's unique identifier for this user. When visitorId is absent, we sear
154
168
  #
155
169
  # @param identity_context [OursprivacyIngest::Models::BatchCreateParams::Event::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
156
170
  #
@@ -159,6 +173,8 @@ module OursprivacyIngest
159
173
  # @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
160
174
  #
161
175
  # @param user_properties [OursprivacyIngest::Models::BatchCreateParams::Event::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
176
+ #
177
+ # @param visitor_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
162
178
 
163
179
  # @see OursprivacyIngest::Models::BatchCreateParams::Event#default_properties
164
180
  class DefaultProperties < OursprivacyIngest::Internal::Type::BaseModel
@@ -43,7 +43,7 @@ module OursprivacyIngest
43
43
  optional :distinct_id, String, api_name: :distinctId, nil?: true
44
44
 
45
45
  # @!attribute email
46
- # The email address of a user. When userId is absent and externalId does not
46
+ # The email address of a user. When visitorId is absent and externalId does not
47
47
  # resolve a visitor, we search your account for a visitor with this email. If no
48
48
  # match is found, we try userProperties.phone_number before creating a new
49
49
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -69,11 +69,11 @@ module OursprivacyIngest
69
69
  nil?: true
70
70
 
71
71
  # @!attribute external_id
72
- # Your system's unique identifier for this user. When userId is absent, we search
73
- # your account for an existing visitor with this externalId. If no match is found,
74
- # we try email and then userProperties.phone_number before creating a new visitor.
75
- # If you also have the userId from cookies or local storage, send both — it
76
- # removes the lookup round-trip. Non-string input is converted to text before
72
+ # Your system's unique identifier for this user. When visitorId is absent, we
73
+ # search your account for an existing visitor with this externalId. If no match is
74
+ # found, we try email and then userProperties.phone_number before creating a new
75
+ # visitor. If you also have the visitorId from cookies or local storage, send both
76
+ # — it removes the lookup round-trip. Non-string input is converted to text before
77
77
  # validation; clients should send a string. Leading and trailing whitespace is
78
78
  # removed before validation.
79
79
  #
@@ -100,11 +100,14 @@ module OursprivacyIngest
100
100
  optional :time, Float, nil?: true
101
101
 
102
102
  # @!attribute user_id
103
+ # @deprecated
104
+ #
103
105
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
104
106
  # When present, this is used directly — no lookup by externalId, email, or phone
105
- # is performed. If you have both a userId and an externalId, send both so the
106
- # event is attached to the right visitor without any lookup overhead. Leading and
107
- # trailing whitespace is removed before validation.
107
+ # is performed. If you have both a visitorId and an externalId, send both so the
108
+ # event is attached to the right visitor without any lookup overhead. visitorId
109
+ # takes precedence over the deprecated userId alias. Leading and trailing
110
+ # whitespace is removed before validation.
108
111
  #
109
112
  # @return [String, nil]
110
113
  optional :user_id, String, api_name: :userId, nil?: true
@@ -119,7 +122,18 @@ module OursprivacyIngest
119
122
  api_name: :userProperties,
120
123
  nil?: true
121
124
 
122
- # @!method initialize(token:, event:, default_properties: nil, distinct_id: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil, request_options: {})
125
+ # @!attribute visitor_id
126
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
127
+ # When present, this is used directly — no lookup by externalId, email, or phone
128
+ # is performed. If you have both a visitorId and an externalId, send both so the
129
+ # event is attached to the right visitor without any lookup overhead. visitorId
130
+ # takes precedence over the deprecated userId alias. Leading and trailing
131
+ # whitespace is removed before validation.
132
+ #
133
+ # @return [String, nil]
134
+ optional :visitor_id, String, api_name: :visitorId, nil?: true
135
+
136
+ # @!method initialize(token:, event:, default_properties: nil, distinct_id: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil, visitor_id: nil, request_options: {})
123
137
  # Some parameter documentations has been truncated, see
124
138
  # {OursprivacyIngest::Models::TrackEventParams} for more details.
125
139
  #
@@ -131,11 +145,11 @@ module OursprivacyIngest
131
145
  #
132
146
  # @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
133
147
  #
134
- # @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
148
+ # @param email [String, nil] The email address of a user. When visitorId is absent and externalId does not re
135
149
  #
136
150
  # @param event_properties [Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, nil}, nil}, nil}, nil}, nil}, nil] Any additional event properties you want to pass along. Use at most 200 nonempty
137
151
  #
138
- # @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
152
+ # @param external_id [String, nil] Your system's unique identifier for this user. When visitorId is absent, we sear
139
153
  #
140
154
  # @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
141
155
  #
@@ -145,6 +159,8 @@ module OursprivacyIngest
145
159
  #
146
160
  # @param user_properties [OursprivacyIngest::Models::TrackEventParams::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
147
161
  #
162
+ # @param visitor_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
163
+ #
148
164
  # @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}]
149
165
 
150
166
  class DefaultProperties < OursprivacyIngest::Internal::Type::BaseModel
@@ -35,7 +35,7 @@ module OursprivacyIngest
35
35
  nil?: true
36
36
 
37
37
  # @!attribute email
38
- # The email address of a user. When userId is absent and externalId does not
38
+ # The email address of a user. When visitorId is absent and externalId does not
39
39
  # resolve a visitor, we search your account for a visitor with this email. If no
40
40
  # match is found, we try userProperties.phone_number before creating a new
41
41
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -44,11 +44,11 @@ module OursprivacyIngest
44
44
  optional :email, String, nil?: true
45
45
 
46
46
  # @!attribute external_id
47
- # Your system's unique identifier for this user. When userId is absent, we search
48
- # your account for an existing visitor with this externalId. If no match is found,
49
- # we try email and then userProperties.phone_number before creating a new visitor.
50
- # If you also have the userId from cookies or local storage, send both — it
51
- # removes the lookup round-trip. Non-string input is converted to text before
47
+ # Your system's unique identifier for this user. When visitorId is absent, we
48
+ # search your account for an existing visitor with this externalId. If no match is
49
+ # found, we try email and then userProperties.phone_number before creating a new
50
+ # visitor. If you also have the visitorId from cookies or local storage, send both
51
+ # — it removes the lookup round-trip. Non-string input is converted to text before
52
52
  # validation; clients should send a string. Leading and trailing whitespace is
53
53
  # removed before validation.
54
54
  #
@@ -67,16 +67,30 @@ module OursprivacyIngest
67
67
  nil?: true
68
68
 
69
69
  # @!attribute user_id
70
+ # @deprecated
71
+ #
70
72
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
71
73
  # When present, this is used directly — no lookup by externalId, email, or phone
72
- # is performed. If you have both a userId and an externalId, send both so the
73
- # event is attached to the right visitor without any lookup overhead. Leading and
74
- # trailing whitespace is removed before validation.
74
+ # is performed. If you have both a visitorId and an externalId, send both so the
75
+ # event is attached to the right visitor without any lookup overhead. visitorId
76
+ # takes precedence over the deprecated userId alias. Leading and trailing
77
+ # whitespace is removed before validation.
75
78
  #
76
79
  # @return [String, nil]
77
80
  optional :user_id, String, api_name: :userId, nil?: true
78
81
 
79
- # @!method initialize(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, request_options: {})
82
+ # @!attribute visitor_id
83
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
84
+ # When present, this is used directly — no lookup by externalId, email, or phone
85
+ # is performed. If you have both a visitorId and an externalId, send both so the
86
+ # event is attached to the right visitor without any lookup overhead. visitorId
87
+ # takes precedence over the deprecated userId alias. Leading and trailing
88
+ # whitespace is removed before validation.
89
+ #
90
+ # @return [String, nil]
91
+ optional :visitor_id, String, api_name: :visitorId, nil?: true
92
+
93
+ # @!method initialize(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, visitor_id: nil, request_options: {})
80
94
  # Some parameter documentations has been truncated, see
81
95
  # {OursprivacyIngest::Models::VisitorUpsertParams} for more details.
82
96
  #
@@ -86,14 +100,16 @@ module OursprivacyIngest
86
100
  #
87
101
  # @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
88
102
  #
89
- # @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
103
+ # @param email [String, nil] The email address of a user. When visitorId is absent and externalId does not re
90
104
  #
91
- # @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
105
+ # @param external_id [String, nil] Your system's unique identifier for this user. When visitorId is absent, we sear
92
106
  #
93
107
  # @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
94
108
  #
95
109
  # @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
96
110
  #
111
+ # @param visitor_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
112
+ #
97
113
  # @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}]
98
114
 
99
115
  class UserProperties < OursprivacyIngest::Internal::Type::BaseModel
@@ -6,20 +6,20 @@ module OursprivacyIngest
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {OursprivacyIngest::Models::TrackEventParams} for more details.
8
8
  #
9
- # Track events from your server. Include userId, externalId, email, or
9
+ # Track events from your server. Include visitorId, externalId, email, or
10
10
  # userProperties.phone_number to associate the event with an existing visitor.
11
- # Identity resolution runs in priority order: userId (direct, no lookup) →
11
+ # Identity resolution runs in priority order: visitorId (direct, no lookup) →
12
12
  # externalId → email → userProperties.phone_number. Each lookup runs only if
13
13
  # earlier identifiers did not resolve a visitor. Phone matching ignores common
14
14
  # formatting and an international + or 00 prefix, but does not infer a country
15
- # code. If you know both userId and externalId, send both. For top-level visitor
16
- # properties: null clears the existing value, while undefined, omitted fields, and
17
- # empty strings are ignored. For entries inside custom_properties: null,
18
- # undefined, and empty strings are all ignored (custom_properties use merge
15
+ # code. If you know both visitorId and externalId, send both. For top-level
16
+ # visitor properties: null clears the existing value, while undefined, omitted
17
+ # fields, and empty strings are ignored. For entries inside custom_properties:
18
+ # null, undefined, and empty strings are all ignored (custom_properties use merge
19
19
  # semantics). See https://docs.oursprivacy.com/docs/data-types for details and
20
20
  # common pitfalls.
21
21
  #
22
- # @overload event(token:, event:, default_properties: nil, distinct_id: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil, request_options: {})
22
+ # @overload event(token:, event:, default_properties: nil, distinct_id: nil, email: nil, event_properties: nil, external_id: nil, identity_context: nil, time: nil, user_id: nil, user_properties: nil, visitor_id: nil, request_options: {})
23
23
  #
24
24
  # @param token [String] The token for your Source. You can find this in the dashboard. Leading and trail
25
25
  #
@@ -29,11 +29,11 @@ module OursprivacyIngest
29
29
  #
30
30
  # @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
31
31
  #
32
- # @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
32
+ # @param email [String, nil] The email address of a user. When visitorId is absent and externalId does not re
33
33
  #
34
34
  # @param event_properties [Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, Hash{Symbol=>String, Float, Boolean, Array<String, Float, Boolean, Array<Object>, Hash{Symbol=>Object}, nil>, nil}, nil}, nil}, nil}, nil}, nil] Any additional event properties you want to pass along. Use at most 200 nonempty
35
35
  #
36
- # @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
36
+ # @param external_id [String, nil] Your system's unique identifier for this user. When visitorId is absent, we sear
37
37
  #
38
38
  # @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
39
39
  #
@@ -43,6 +43,8 @@ module OursprivacyIngest
43
43
  #
44
44
  # @param user_properties [OursprivacyIngest::Models::TrackEventParams::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
45
45
  #
46
+ # @param visitor_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
47
+ #
46
48
  # @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}, nil]
47
49
  #
48
50
  # @return [OursprivacyIngest::Models::TrackEventResponse]
@@ -8,7 +8,7 @@ module OursprivacyIngest
8
8
  #
9
9
  # Set or update properties on an existing visitor, or create a new visitor if no
10
10
  # match is found. This fires a $identify event, making the call visible in the
11
- # event stream. Identity resolution runs in priority order: userId (direct, no
11
+ # event stream. Identity resolution runs in priority order: visitorId (direct, no
12
12
  # lookup) → externalId → email → userProperties.phone_number. Each lookup runs
13
13
  # only if earlier identifiers did not resolve a visitor. Phone matching ignores
14
14
  # common formatting and an international + or 00 prefix, but does not infer a
@@ -20,7 +20,7 @@ module OursprivacyIngest
20
20
  # semantics). See https://docs.oursprivacy.com/docs/data-types for details and
21
21
  # common pitfalls.
22
22
  #
23
- # @overload upsert(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, request_options: {})
23
+ # @overload upsert(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, visitor_id: nil, request_options: {})
24
24
  #
25
25
  # @param token [String] The token for your Source. You can find this in the dashboard. Leading and trail
26
26
  #
@@ -28,14 +28,16 @@ module OursprivacyIngest
28
28
  #
29
29
  # @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
30
30
  #
31
- # @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
31
+ # @param email [String, nil] The email address of a user. When visitorId is absent and externalId does not re
32
32
  #
33
- # @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
33
+ # @param external_id [String, nil] Your system's unique identifier for this user. When visitorId is absent, we sear
34
34
  #
35
35
  # @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
36
36
  #
37
37
  # @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
38
38
  #
39
+ # @param visitor_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
40
+ #
39
41
  # @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}, nil]
40
42
  #
41
43
  # @return [OursprivacyIngest::Models::VisitorUpsertResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OursprivacyIngest
4
- VERSION = "2.1.0"
4
+ VERSION = "2.2.0"
5
5
  end
@@ -95,7 +95,7 @@ module OursprivacyIngest
95
95
  end
96
96
  attr_writer :default_properties
97
97
 
98
- # The email address of a user. When userId is absent and externalId does not
98
+ # The email address of a user. When visitorId is absent and externalId does not
99
99
  # resolve a visitor, we search your account for a visitor with this email. If no
100
100
  # match is found, we try userProperties.phone_number before creating a new
101
101
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -122,11 +122,11 @@ module OursprivacyIngest
122
122
  end
123
123
  attr_accessor :event_properties
124
124
 
125
- # Your system's unique identifier for this user. When userId is absent, we search
126
- # your account for an existing visitor with this externalId. If no match is found,
127
- # we try email and then userProperties.phone_number before creating a new visitor.
128
- # If you also have the userId from cookies or local storage, send both — it
129
- # removes the lookup round-trip. Non-string input is converted to text before
125
+ # Your system's unique identifier for this user. When visitorId is absent, we
126
+ # search your account for an existing visitor with this externalId. If no match is
127
+ # found, we try email and then userProperties.phone_number before creating a new
128
+ # visitor. If you also have the visitorId from cookies or local storage, send both
129
+ # — it removes the lookup round-trip. Non-string input is converted to text before
130
130
  # validation; clients should send a string. Leading and trailing whitespace is
131
131
  # removed before validation.
132
132
  sig { returns(T.nilable(String)) }
@@ -162,9 +162,10 @@ module OursprivacyIngest
162
162
 
163
163
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
164
164
  # When present, this is used directly — no lookup by externalId, email, or phone
165
- # is performed. If you have both a userId and an externalId, send both so the
166
- # event is attached to the right visitor without any lookup overhead. Leading and
167
- # trailing whitespace is removed before validation.
165
+ # is performed. If you have both a visitorId and an externalId, send both so the
166
+ # event is attached to the right visitor without any lookup overhead. visitorId
167
+ # takes precedence over the deprecated userId alias. Leading and trailing
168
+ # whitespace is removed before validation.
168
169
  sig { returns(T.nilable(String)) }
169
170
  attr_accessor :user_id
170
171
 
@@ -189,6 +190,15 @@ module OursprivacyIngest
189
190
  end
190
191
  attr_writer :user_properties
191
192
 
193
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
194
+ # When present, this is used directly — no lookup by externalId, email, or phone
195
+ # is performed. If you have both a visitorId and an externalId, send both so the
196
+ # event is attached to the right visitor without any lookup overhead. visitorId
197
+ # takes precedence over the deprecated userId alias. Leading and trailing
198
+ # whitespace is removed before validation.
199
+ sig { returns(T.nilable(String)) }
200
+ attr_accessor :visitor_id
201
+
192
202
  sig do
193
203
  params(
194
204
  distinct_id: String,
@@ -217,7 +227,8 @@ module OursprivacyIngest
217
227
  user_properties:
218
228
  T.nilable(
219
229
  OursprivacyIngest::BatchCreateParams::Event::UserProperties::OrHash
220
- )
230
+ ),
231
+ visitor_id: T.nilable(String)
221
232
  ).returns(T.attached_class)
222
233
  end
223
234
  def self.new(
@@ -233,7 +244,7 @@ module OursprivacyIngest
233
244
  # These properties are used throughout the Ours app to pass known values onto
234
245
  # destinations
235
246
  default_properties: nil,
236
- # The email address of a user. When userId is absent and externalId does not
247
+ # The email address of a user. When visitorId is absent and externalId does not
237
248
  # resolve a visitor, we search your account for a visitor with this email. If no
238
249
  # match is found, we try userProperties.phone_number before creating a new
239
250
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -245,11 +256,11 @@ module OursprivacyIngest
245
256
  # strings. After normalization, the serialized JSON must be shorter than 1,048,576
246
257
  # UTF-16 code units.
247
258
  event_properties: nil,
248
- # Your system's unique identifier for this user. When userId is absent, we search
249
- # your account for an existing visitor with this externalId. If no match is found,
250
- # we try email and then userProperties.phone_number before creating a new visitor.
251
- # If you also have the userId from cookies or local storage, send both — it
252
- # removes the lookup round-trip. Non-string input is converted to text before
259
+ # Your system's unique identifier for this user. When visitorId is absent, we
260
+ # search your account for an existing visitor with this externalId. If no match is
261
+ # found, we try email and then userProperties.phone_number before creating a new
262
+ # visitor. If you also have the visitorId from cookies or local storage, send both
263
+ # — it removes the lookup round-trip. Non-string input is converted to text before
253
264
  # validation; clients should send a string. Leading and trailing whitespace is
254
265
  # removed before validation.
255
266
  external_id: nil,
@@ -263,13 +274,21 @@ module OursprivacyIngest
263
274
  time: nil,
264
275
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
265
276
  # When present, this is used directly — no lookup by externalId, email, or phone
266
- # is performed. If you have both a userId and an externalId, send both so the
267
- # event is attached to the right visitor without any lookup overhead. Leading and
268
- # trailing whitespace is removed before validation.
277
+ # is performed. If you have both a visitorId and an externalId, send both so the
278
+ # event is attached to the right visitor without any lookup overhead. visitorId
279
+ # takes precedence over the deprecated userId alias. Leading and trailing
280
+ # whitespace is removed before validation.
269
281
  user_id: nil,
270
282
  # Properties to set on the visitor. (optional) You can also update these
271
283
  # properties via the identify endpoint.
272
- user_properties: nil
284
+ user_properties: nil,
285
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
286
+ # When present, this is used directly — no lookup by externalId, email, or phone
287
+ # is performed. If you have both a visitorId and an externalId, send both so the
288
+ # event is attached to the right visitor without any lookup overhead. visitorId
289
+ # takes precedence over the deprecated userId alias. Leading and trailing
290
+ # whitespace is removed before validation.
291
+ visitor_id: nil
273
292
  )
274
293
  end
275
294
 
@@ -302,7 +321,8 @@ module OursprivacyIngest
302
321
  user_properties:
303
322
  T.nilable(
304
323
  OursprivacyIngest::BatchCreateParams::Event::UserProperties
305
- )
324
+ ),
325
+ visitor_id: T.nilable(String)
306
326
  }
307
327
  )
308
328
  end
@@ -52,7 +52,7 @@ module OursprivacyIngest
52
52
  sig { returns(T.nilable(String)) }
53
53
  attr_accessor :distinct_id
54
54
 
55
- # The email address of a user. When userId is absent and externalId does not
55
+ # The email address of a user. When visitorId is absent and externalId does not
56
56
  # resolve a visitor, we search your account for a visitor with this email. If no
57
57
  # match is found, we try userProperties.phone_number before creating a new
58
58
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -79,11 +79,11 @@ module OursprivacyIngest
79
79
  end
80
80
  attr_accessor :event_properties
81
81
 
82
- # Your system's unique identifier for this user. When userId is absent, we search
83
- # your account for an existing visitor with this externalId. If no match is found,
84
- # we try email and then userProperties.phone_number before creating a new visitor.
85
- # If you also have the userId from cookies or local storage, send both — it
86
- # removes the lookup round-trip. Non-string input is converted to text before
82
+ # Your system's unique identifier for this user. When visitorId is absent, we
83
+ # search your account for an existing visitor with this externalId. If no match is
84
+ # found, we try email and then userProperties.phone_number before creating a new
85
+ # visitor. If you also have the visitorId from cookies or local storage, send both
86
+ # — it removes the lookup round-trip. Non-string input is converted to text before
87
87
  # validation; clients should send a string. Leading and trailing whitespace is
88
88
  # removed before validation.
89
89
  sig { returns(T.nilable(String)) }
@@ -115,9 +115,10 @@ module OursprivacyIngest
115
115
 
116
116
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
117
117
  # When present, this is used directly — no lookup by externalId, email, or phone
118
- # is performed. If you have both a userId and an externalId, send both so the
119
- # event is attached to the right visitor without any lookup overhead. Leading and
120
- # trailing whitespace is removed before validation.
118
+ # is performed. If you have both a visitorId and an externalId, send both so the
119
+ # event is attached to the right visitor without any lookup overhead. visitorId
120
+ # takes precedence over the deprecated userId alias. Leading and trailing
121
+ # whitespace is removed before validation.
121
122
  sig { returns(T.nilable(String)) }
122
123
  attr_accessor :user_id
123
124
 
@@ -138,6 +139,15 @@ module OursprivacyIngest
138
139
  end
139
140
  attr_writer :user_properties
140
141
 
142
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
143
+ # When present, this is used directly — no lookup by externalId, email, or phone
144
+ # is performed. If you have both a visitorId and an externalId, send both so the
145
+ # event is attached to the right visitor without any lookup overhead. visitorId
146
+ # takes precedence over the deprecated userId alias. Leading and trailing
147
+ # whitespace is removed before validation.
148
+ sig { returns(T.nilable(String)) }
149
+ attr_accessor :visitor_id
150
+
141
151
  sig do
142
152
  params(
143
153
  token: String,
@@ -168,6 +178,7 @@ module OursprivacyIngest
168
178
  T.nilable(
169
179
  OursprivacyIngest::TrackEventParams::UserProperties::OrHash
170
180
  ),
181
+ visitor_id: T.nilable(String),
171
182
  request_options: OursprivacyIngest::RequestOptions::OrHash
172
183
  ).returns(T.attached_class)
173
184
  end
@@ -188,7 +199,7 @@ module OursprivacyIngest
188
199
  # clients should send a string. Leading and trailing whitespace is removed before
189
200
  # validation.
190
201
  distinct_id: nil,
191
- # The email address of a user. When userId is absent and externalId does not
202
+ # The email address of a user. When visitorId is absent and externalId does not
192
203
  # resolve a visitor, we search your account for a visitor with this email. If no
193
204
  # match is found, we try userProperties.phone_number before creating a new
194
205
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -200,11 +211,11 @@ module OursprivacyIngest
200
211
  # strings. After normalization, the serialized JSON must be shorter than 1,048,576
201
212
  # UTF-16 code units.
202
213
  event_properties: nil,
203
- # Your system's unique identifier for this user. When userId is absent, we search
204
- # your account for an existing visitor with this externalId. If no match is found,
205
- # we try email and then userProperties.phone_number before creating a new visitor.
206
- # If you also have the userId from cookies or local storage, send both — it
207
- # removes the lookup round-trip. Non-string input is converted to text before
214
+ # Your system's unique identifier for this user. When visitorId is absent, we
215
+ # search your account for an existing visitor with this externalId. If no match is
216
+ # found, we try email and then userProperties.phone_number before creating a new
217
+ # visitor. If you also have the visitorId from cookies or local storage, send both
218
+ # — it removes the lookup round-trip. Non-string input is converted to text before
208
219
  # validation; clients should send a string. Leading and trailing whitespace is
209
220
  # removed before validation.
210
221
  external_id: nil,
@@ -218,13 +229,21 @@ module OursprivacyIngest
218
229
  time: nil,
219
230
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
220
231
  # When present, this is used directly — no lookup by externalId, email, or phone
221
- # is performed. If you have both a userId and an externalId, send both so the
222
- # event is attached to the right visitor without any lookup overhead. Leading and
223
- # trailing whitespace is removed before validation.
232
+ # is performed. If you have both a visitorId and an externalId, send both so the
233
+ # event is attached to the right visitor without any lookup overhead. visitorId
234
+ # takes precedence over the deprecated userId alias. Leading and trailing
235
+ # whitespace is removed before validation.
224
236
  user_id: nil,
225
237
  # Properties to set on the visitor. (optional) You can also update these
226
238
  # properties via the identify endpoint.
227
239
  user_properties: nil,
240
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
241
+ # When present, this is used directly — no lookup by externalId, email, or phone
242
+ # is performed. If you have both a visitorId and an externalId, send both so the
243
+ # event is attached to the right visitor without any lookup overhead. visitorId
244
+ # takes precedence over the deprecated userId alias. Leading and trailing
245
+ # whitespace is removed before validation.
246
+ visitor_id: nil,
228
247
  request_options: {}
229
248
  )
230
249
  end
@@ -254,6 +273,7 @@ module OursprivacyIngest
254
273
  user_id: T.nilable(String),
255
274
  user_properties:
256
275
  T.nilable(OursprivacyIngest::TrackEventParams::UserProperties),
276
+ visitor_id: T.nilable(String),
257
277
  request_options: OursprivacyIngest::RequestOptions
258
278
  }
259
279
  )
@@ -52,18 +52,18 @@ module OursprivacyIngest
52
52
  end
53
53
  attr_writer :default_properties
54
54
 
55
- # The email address of a user. When userId is absent and externalId does not
55
+ # The email address of a user. When visitorId is absent and externalId does not
56
56
  # resolve a visitor, we search your account for a visitor with this email. If no
57
57
  # match is found, we try userProperties.phone_number before creating a new
58
58
  # visitor. Leading and trailing whitespace is removed before validation.
59
59
  sig { returns(T.nilable(String)) }
60
60
  attr_accessor :email
61
61
 
62
- # Your system's unique identifier for this user. When userId is absent, we search
63
- # your account for an existing visitor with this externalId. If no match is found,
64
- # we try email and then userProperties.phone_number before creating a new visitor.
65
- # If you also have the userId from cookies or local storage, send both — it
66
- # removes the lookup round-trip. Non-string input is converted to text before
62
+ # Your system's unique identifier for this user. When visitorId is absent, we
63
+ # search your account for an existing visitor with this externalId. If no match is
64
+ # found, we try email and then userProperties.phone_number before creating a new
65
+ # visitor. If you also have the visitorId from cookies or local storage, send both
66
+ # — it removes the lookup round-trip. Non-string input is converted to text before
67
67
  # validation; clients should send a string. Leading and trailing whitespace is
68
68
  # removed before validation.
69
69
  sig { returns(T.nilable(String)) }
@@ -91,12 +91,22 @@ module OursprivacyIngest
91
91
 
92
92
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
93
93
  # When present, this is used directly — no lookup by externalId, email, or phone
94
- # is performed. If you have both a userId and an externalId, send both so the
95
- # event is attached to the right visitor without any lookup overhead. Leading and
96
- # trailing whitespace is removed before validation.
94
+ # is performed. If you have both a visitorId and an externalId, send both so the
95
+ # event is attached to the right visitor without any lookup overhead. visitorId
96
+ # takes precedence over the deprecated userId alias. Leading and trailing
97
+ # whitespace is removed before validation.
97
98
  sig { returns(T.nilable(String)) }
98
99
  attr_accessor :user_id
99
100
 
101
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
102
+ # When present, this is used directly — no lookup by externalId, email, or phone
103
+ # is performed. If you have both a visitorId and an externalId, send both so the
104
+ # event is attached to the right visitor without any lookup overhead. visitorId
105
+ # takes precedence over the deprecated userId alias. Leading and trailing
106
+ # whitespace is removed before validation.
107
+ sig { returns(T.nilable(String)) }
108
+ attr_accessor :visitor_id
109
+
100
110
  sig do
101
111
  params(
102
112
  token: String,
@@ -113,6 +123,7 @@ module OursprivacyIngest
113
123
  OursprivacyIngest::VisitorUpsertParams::IdentityContext::OrHash
114
124
  ),
115
125
  user_id: T.nilable(String),
126
+ visitor_id: T.nilable(String),
116
127
  request_options: OursprivacyIngest::RequestOptions::OrHash
117
128
  ).returns(T.attached_class)
118
129
  end
@@ -127,16 +138,16 @@ module OursprivacyIngest
127
138
  # These properties are used throughout the Ours app to pass known values onto
128
139
  # destinations
129
140
  default_properties: nil,
130
- # The email address of a user. When userId is absent and externalId does not
141
+ # The email address of a user. When visitorId is absent and externalId does not
131
142
  # resolve a visitor, we search your account for a visitor with this email. If no
132
143
  # match is found, we try userProperties.phone_number before creating a new
133
144
  # visitor. Leading and trailing whitespace is removed before validation.
134
145
  email: nil,
135
- # Your system's unique identifier for this user. When userId is absent, we search
136
- # your account for an existing visitor with this externalId. If no match is found,
137
- # we try email and then userProperties.phone_number before creating a new visitor.
138
- # If you also have the userId from cookies or local storage, send both — it
139
- # removes the lookup round-trip. Non-string input is converted to text before
146
+ # Your system's unique identifier for this user. When visitorId is absent, we
147
+ # search your account for an existing visitor with this externalId. If no match is
148
+ # found, we try email and then userProperties.phone_number before creating a new
149
+ # visitor. If you also have the visitorId from cookies or local storage, send both
150
+ # — it removes the lookup round-trip. Non-string input is converted to text before
140
151
  # validation; clients should send a string. Leading and trailing whitespace is
141
152
  # removed before validation.
142
153
  external_id: nil,
@@ -146,10 +157,18 @@ module OursprivacyIngest
146
157
  identity_context: nil,
147
158
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
148
159
  # When present, this is used directly — no lookup by externalId, email, or phone
149
- # is performed. If you have both a userId and an externalId, send both so the
150
- # event is attached to the right visitor without any lookup overhead. Leading and
151
- # trailing whitespace is removed before validation.
160
+ # is performed. If you have both a visitorId and an externalId, send both so the
161
+ # event is attached to the right visitor without any lookup overhead. visitorId
162
+ # takes precedence over the deprecated userId alias. Leading and trailing
163
+ # whitespace is removed before validation.
152
164
  user_id: nil,
165
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
166
+ # When present, this is used directly — no lookup by externalId, email, or phone
167
+ # is performed. If you have both a visitorId and an externalId, send both so the
168
+ # event is attached to the right visitor without any lookup overhead. visitorId
169
+ # takes precedence over the deprecated userId alias. Leading and trailing
170
+ # whitespace is removed before validation.
171
+ visitor_id: nil,
153
172
  request_options: {}
154
173
  )
155
174
  end
@@ -171,6 +190,7 @@ module OursprivacyIngest
171
190
  OursprivacyIngest::VisitorUpsertParams::IdentityContext
172
191
  ),
173
192
  user_id: T.nilable(String),
193
+ visitor_id: T.nilable(String),
174
194
  request_options: OursprivacyIngest::RequestOptions
175
195
  }
176
196
  )
@@ -3,16 +3,16 @@
3
3
  module OursprivacyIngest
4
4
  module Resources
5
5
  class Track
6
- # Track events from your server. Include userId, externalId, email, or
6
+ # Track events from your server. Include visitorId, externalId, email, or
7
7
  # userProperties.phone_number to associate the event with an existing visitor.
8
- # Identity resolution runs in priority order: userId (direct, no lookup) →
8
+ # Identity resolution runs in priority order: visitorId (direct, no lookup) →
9
9
  # externalId → email → userProperties.phone_number. Each lookup runs only if
10
10
  # earlier identifiers did not resolve a visitor. Phone matching ignores common
11
11
  # formatting and an international + or 00 prefix, but does not infer a country
12
- # code. If you know both userId and externalId, send both. For top-level visitor
13
- # properties: null clears the existing value, while undefined, omitted fields, and
14
- # empty strings are ignored. For entries inside custom_properties: null,
15
- # undefined, and empty strings are all ignored (custom_properties use merge
12
+ # code. If you know both visitorId and externalId, send both. For top-level
13
+ # visitor properties: null clears the existing value, while undefined, omitted
14
+ # fields, and empty strings are ignored. For entries inside custom_properties:
15
+ # null, undefined, and empty strings are all ignored (custom_properties use merge
16
16
  # semantics). See https://docs.oursprivacy.com/docs/data-types for details and
17
17
  # common pitfalls.
18
18
  sig do
@@ -45,6 +45,7 @@ module OursprivacyIngest
45
45
  T.nilable(
46
46
  OursprivacyIngest::TrackEventParams::UserProperties::OrHash
47
47
  ),
48
+ visitor_id: T.nilable(String),
48
49
  request_options: OursprivacyIngest::RequestOptions::OrHash
49
50
  ).returns(OursprivacyIngest::Models::TrackEventResponse)
50
51
  end
@@ -65,7 +66,7 @@ module OursprivacyIngest
65
66
  # clients should send a string. Leading and trailing whitespace is removed before
66
67
  # validation.
67
68
  distinct_id: nil,
68
- # The email address of a user. When userId is absent and externalId does not
69
+ # The email address of a user. When visitorId is absent and externalId does not
69
70
  # resolve a visitor, we search your account for a visitor with this email. If no
70
71
  # match is found, we try userProperties.phone_number before creating a new
71
72
  # visitor. Leading and trailing whitespace is removed before validation.
@@ -77,11 +78,11 @@ module OursprivacyIngest
77
78
  # strings. After normalization, the serialized JSON must be shorter than 1,048,576
78
79
  # UTF-16 code units.
79
80
  event_properties: nil,
80
- # Your system's unique identifier for this user. When userId is absent, we search
81
- # your account for an existing visitor with this externalId. If no match is found,
82
- # we try email and then userProperties.phone_number before creating a new visitor.
83
- # If you also have the userId from cookies or local storage, send both — it
84
- # removes the lookup round-trip. Non-string input is converted to text before
81
+ # Your system's unique identifier for this user. When visitorId is absent, we
82
+ # search your account for an existing visitor with this externalId. If no match is
83
+ # found, we try email and then userProperties.phone_number before creating a new
84
+ # visitor. If you also have the visitorId from cookies or local storage, send both
85
+ # — it removes the lookup round-trip. Non-string input is converted to text before
85
86
  # validation; clients should send a string. Leading and trailing whitespace is
86
87
  # removed before validation.
87
88
  external_id: nil,
@@ -95,13 +96,21 @@ module OursprivacyIngest
95
96
  time: nil,
96
97
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
97
98
  # When present, this is used directly — no lookup by externalId, email, or phone
98
- # is performed. If you have both a userId and an externalId, send both so the
99
- # event is attached to the right visitor without any lookup overhead. Leading and
100
- # trailing whitespace is removed before validation.
99
+ # is performed. If you have both a visitorId and an externalId, send both so the
100
+ # event is attached to the right visitor without any lookup overhead. visitorId
101
+ # takes precedence over the deprecated userId alias. Leading and trailing
102
+ # whitespace is removed before validation.
101
103
  user_id: nil,
102
104
  # Properties to set on the visitor. (optional) You can also update these
103
105
  # properties via the identify endpoint.
104
106
  user_properties: nil,
107
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
108
+ # When present, this is used directly — no lookup by externalId, email, or phone
109
+ # is performed. If you have both a visitorId and an externalId, send both so the
110
+ # event is attached to the right visitor without any lookup overhead. visitorId
111
+ # takes precedence over the deprecated userId alias. Leading and trailing
112
+ # whitespace is removed before validation.
113
+ visitor_id: nil,
105
114
  request_options: {}
106
115
  )
107
116
  end
@@ -5,7 +5,7 @@ module OursprivacyIngest
5
5
  class Visitor
6
6
  # Set or update properties on an existing visitor, or create a new visitor if no
7
7
  # match is found. This fires a $identify event, making the call visible in the
8
- # event stream. Identity resolution runs in priority order: userId (direct, no
8
+ # event stream. Identity resolution runs in priority order: visitorId (direct, no
9
9
  # lookup) → externalId → email → userProperties.phone_number. Each lookup runs
10
10
  # only if earlier identifiers did not resolve a visitor. Phone matching ignores
11
11
  # common formatting and an international + or 00 prefix, but does not infer a
@@ -32,6 +32,7 @@ module OursprivacyIngest
32
32
  OursprivacyIngest::VisitorUpsertParams::IdentityContext::OrHash
33
33
  ),
34
34
  user_id: T.nilable(String),
35
+ visitor_id: T.nilable(String),
35
36
  request_options: OursprivacyIngest::RequestOptions::OrHash
36
37
  ).returns(OursprivacyIngest::Models::VisitorUpsertResponse)
37
38
  end
@@ -46,16 +47,16 @@ module OursprivacyIngest
46
47
  # These properties are used throughout the Ours app to pass known values onto
47
48
  # destinations
48
49
  default_properties: nil,
49
- # The email address of a user. When userId is absent and externalId does not
50
+ # The email address of a user. When visitorId is absent and externalId does not
50
51
  # resolve a visitor, we search your account for a visitor with this email. If no
51
52
  # match is found, we try userProperties.phone_number before creating a new
52
53
  # visitor. Leading and trailing whitespace is removed before validation.
53
54
  email: nil,
54
- # Your system's unique identifier for this user. When userId is absent, we search
55
- # your account for an existing visitor with this externalId. If no match is found,
56
- # we try email and then userProperties.phone_number before creating a new visitor.
57
- # If you also have the userId from cookies or local storage, send both — it
58
- # removes the lookup round-trip. Non-string input is converted to text before
55
+ # Your system's unique identifier for this user. When visitorId is absent, we
56
+ # search your account for an existing visitor with this externalId. If no match is
57
+ # found, we try email and then userProperties.phone_number before creating a new
58
+ # visitor. If you also have the visitorId from cookies or local storage, send both
59
+ # — it removes the lookup round-trip. Non-string input is converted to text before
59
60
  # validation; clients should send a string. Leading and trailing whitespace is
60
61
  # removed before validation.
61
62
  external_id: nil,
@@ -65,10 +66,18 @@ module OursprivacyIngest
65
66
  identity_context: nil,
66
67
  # The Ours Visitor ID stored in local storage and cookies on your web properties.
67
68
  # When present, this is used directly — no lookup by externalId, email, or phone
68
- # is performed. If you have both a userId and an externalId, send both so the
69
- # event is attached to the right visitor without any lookup overhead. Leading and
70
- # trailing whitespace is removed before validation.
69
+ # is performed. If you have both a visitorId and an externalId, send both so the
70
+ # event is attached to the right visitor without any lookup overhead. visitorId
71
+ # takes precedence over the deprecated userId alias. Leading and trailing
72
+ # whitespace is removed before validation.
71
73
  user_id: nil,
74
+ # The Ours Visitor ID stored in local storage and cookies on your web properties.
75
+ # When present, this is used directly — no lookup by externalId, email, or phone
76
+ # is performed. If you have both a visitorId and an externalId, send both so the
77
+ # event is attached to the right visitor without any lookup overhead. visitorId
78
+ # takes precedence over the deprecated userId alias. Leading and trailing
79
+ # whitespace is removed before validation.
80
+ visitor_id: nil,
72
81
  request_options: {}
73
82
  )
74
83
  end
@@ -38,7 +38,8 @@ module OursprivacyIngest
38
38
  identity_context: OursprivacyIngest::BatchCreateParams::Event::IdentityContext?,
39
39
  time: Float?,
40
40
  user_id: String?,
41
- user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?
41
+ user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?,
42
+ visitor_id: String?
42
43
  }
43
44
 
44
45
  class Event < OursprivacyIngest::Internal::Type::BaseModel
@@ -62,6 +63,8 @@ module OursprivacyIngest
62
63
 
63
64
  attr_accessor user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?
64
65
 
66
+ attr_accessor visitor_id: String?
67
+
65
68
  def initialize: (
66
69
  distinct_id: String,
67
70
  event: String,
@@ -72,7 +75,8 @@ module OursprivacyIngest
72
75
  ?identity_context: OursprivacyIngest::BatchCreateParams::Event::IdentityContext?,
73
76
  ?time: Float?,
74
77
  ?user_id: String?,
75
- ?user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?
78
+ ?user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?,
79
+ ?visitor_id: String?
76
80
  ) -> void
77
81
 
78
82
  def to_hash: -> {
@@ -85,7 +89,8 @@ module OursprivacyIngest
85
89
  identity_context: OursprivacyIngest::BatchCreateParams::Event::IdentityContext?,
86
90
  time: Float?,
87
91
  user_id: String?,
88
- user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?
92
+ user_properties: OursprivacyIngest::BatchCreateParams::Event::UserProperties?,
93
+ visitor_id: String?
89
94
  }
90
95
 
91
96
  type default_properties =
@@ -12,7 +12,8 @@ module OursprivacyIngest
12
12
  identity_context: OursprivacyIngest::TrackEventParams::IdentityContext?,
13
13
  time: Float?,
14
14
  user_id: String?,
15
- user_properties: OursprivacyIngest::TrackEventParams::UserProperties?
15
+ user_properties: OursprivacyIngest::TrackEventParams::UserProperties?,
16
+ visitor_id: String?
16
17
  }
17
18
  & OursprivacyIngest::Internal::Type::request_parameters
18
19
 
@@ -42,6 +43,8 @@ module OursprivacyIngest
42
43
 
43
44
  attr_accessor user_properties: OursprivacyIngest::TrackEventParams::UserProperties?
44
45
 
46
+ attr_accessor visitor_id: String?
47
+
45
48
  def initialize: (
46
49
  token: String,
47
50
  event: String,
@@ -54,6 +57,7 @@ module OursprivacyIngest
54
57
  ?time: Float?,
55
58
  ?user_id: String?,
56
59
  ?user_properties: OursprivacyIngest::TrackEventParams::UserProperties?,
60
+ ?visitor_id: String?,
57
61
  ?request_options: OursprivacyIngest::request_opts
58
62
  ) -> void
59
63
 
@@ -69,6 +73,7 @@ module OursprivacyIngest
69
73
  time: Float?,
70
74
  user_id: String?,
71
75
  user_properties: OursprivacyIngest::TrackEventParams::UserProperties?,
76
+ visitor_id: String?,
72
77
  request_options: OursprivacyIngest::RequestOptions
73
78
  }
74
79
 
@@ -8,7 +8,8 @@ module OursprivacyIngest
8
8
  email: String?,
9
9
  external_id: String?,
10
10
  identity_context: OursprivacyIngest::VisitorUpsertParams::IdentityContext?,
11
- user_id: String?
11
+ user_id: String?,
12
+ visitor_id: String?
12
13
  }
13
14
  & OursprivacyIngest::Internal::Type::request_parameters
14
15
 
@@ -30,6 +31,8 @@ module OursprivacyIngest
30
31
 
31
32
  attr_accessor user_id: String?
32
33
 
34
+ attr_accessor visitor_id: String?
35
+
33
36
  def initialize: (
34
37
  token: String,
35
38
  user_properties: OursprivacyIngest::VisitorUpsertParams::UserProperties,
@@ -38,6 +41,7 @@ module OursprivacyIngest
38
41
  ?external_id: String?,
39
42
  ?identity_context: OursprivacyIngest::VisitorUpsertParams::IdentityContext?,
40
43
  ?user_id: String?,
44
+ ?visitor_id: String?,
41
45
  ?request_options: OursprivacyIngest::request_opts
42
46
  ) -> void
43
47
 
@@ -49,6 +53,7 @@ module OursprivacyIngest
49
53
  external_id: String?,
50
54
  identity_context: OursprivacyIngest::VisitorUpsertParams::IdentityContext?,
51
55
  user_id: String?,
56
+ visitor_id: String?,
52
57
  request_options: OursprivacyIngest::RequestOptions
53
58
  }
54
59
 
@@ -13,6 +13,7 @@ module OursprivacyIngest
13
13
  ?time: Float?,
14
14
  ?user_id: String?,
15
15
  ?user_properties: OursprivacyIngest::TrackEventParams::UserProperties?,
16
+ ?visitor_id: String?,
16
17
  ?request_options: OursprivacyIngest::request_opts
17
18
  ) -> OursprivacyIngest::Models::TrackEventResponse
18
19
 
@@ -9,6 +9,7 @@ module OursprivacyIngest
9
9
  ?external_id: String?,
10
10
  ?identity_context: OursprivacyIngest::VisitorUpsertParams::IdentityContext?,
11
11
  ?user_id: String?,
12
+ ?visitor_id: String?,
12
13
  ?request_options: OursprivacyIngest::request_opts
13
14
  ) -> OursprivacyIngest::Models::VisitorUpsertResponse
14
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oursprivacy-ingest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ours Privacy