oursprivacy-ingest 1.18.0 → 1.20.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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/oursprivacy_ingest/models/batch_create_params.rb +14 -13
- data/lib/oursprivacy_ingest/models/experiment_personalization_response.rb +37 -32
- data/lib/oursprivacy_ingest/models/track_event_params.rb +14 -13
- data/lib/oursprivacy_ingest/models/visitor_upsert_params.rb +14 -13
- data/lib/oursprivacy_ingest/resources/experiments.rb +4 -7
- data/lib/oursprivacy_ingest/resources/track.rb +14 -11
- data/lib/oursprivacy_ingest/resources/visitor.rb +12 -9
- data/lib/oursprivacy_ingest/version.rb +1 -1
- data/rbi/oursprivacy_ingest/models/batch_create_params.rbi +24 -22
- data/rbi/oursprivacy_ingest/models/experiment_personalization_response.rbi +81 -63
- data/rbi/oursprivacy_ingest/models/track_event_params.rbi +24 -22
- data/rbi/oursprivacy_ingest/models/visitor_upsert_params.rbi +24 -22
- data/rbi/oursprivacy_ingest/resources/experiments.rbi +4 -7
- data/rbi/oursprivacy_ingest/resources/track.rbi +24 -20
- data/rbi/oursprivacy_ingest/resources/visitor.rbi +22 -18
- data/sig/oursprivacy_ingest/models/experiment_personalization_response.rbs +30 -26
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 339521757ce7143715d8ba15b4bd6ca9e58b4af951d2093b0b069ee0f28aee31
|
|
4
|
+
data.tar.gz: 56b08685191af7d24663f35cf4769d5bc1910ef7eabd98b88e6d7340d126d159
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5d59c9d1ff7a93201ad6e1afb93ee9f12e008803887d4b7988077ce57c58a2f8c7ffea47839469e57c77f0a81bbafcc68150818da3c37687db6f8118d26b206
|
|
7
|
+
data.tar.gz: e22017a3346aab0c6b497b93cc3e1da611d2f23134f9367cdbdeb235c30ae610d6b8626d3ad13bcf1f1ecf6fe46287af4962cae46baa3ddfab7190807b080e26
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.20.0 (2026-09-23)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.19.0...v1.20.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v1.19.0...v1.20.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** API update.
|
|
10
|
+
## 1.19.0 (2026-09-14)
|
|
11
|
+
|
|
12
|
+
Full Changelog: [v1.18.0...v1.19.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v1.18.0...v1.19.0)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **api:** API update.
|
|
3
17
|
## 1.18.0 (2026-09-11)
|
|
4
18
|
|
|
5
19
|
Full Changelog: [v1.17.0...v1.18.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v1.17.0...v1.18.0)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "oursprivacy-ingest", "~> 1.
|
|
18
|
+
gem "oursprivacy-ingest", "~> 1.20.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -55,9 +55,10 @@ module OursprivacyIngest
|
|
|
55
55
|
nil?: true
|
|
56
56
|
|
|
57
57
|
# @!attribute email
|
|
58
|
-
# The email address of a user.
|
|
59
|
-
#
|
|
60
|
-
#
|
|
58
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
59
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
60
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
61
|
+
# visitor.
|
|
61
62
|
#
|
|
62
63
|
# @return [String, nil]
|
|
63
64
|
optional :email, String, nil?: true
|
|
@@ -72,11 +73,11 @@ module OursprivacyIngest
|
|
|
72
73
|
nil?: true
|
|
73
74
|
|
|
74
75
|
# @!attribute external_id
|
|
75
|
-
# Your system's unique identifier for this user.
|
|
76
|
-
# existing visitor with this externalId
|
|
77
|
-
#
|
|
78
|
-
#
|
|
79
|
-
#
|
|
76
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
77
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
78
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
79
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
80
|
+
# removes the lookup round-trip.
|
|
80
81
|
#
|
|
81
82
|
# @return [String, nil]
|
|
82
83
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -101,9 +102,9 @@ module OursprivacyIngest
|
|
|
101
102
|
|
|
102
103
|
# @!attribute user_id
|
|
103
104
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
104
|
-
# When present, this is used directly — no lookup by externalId or
|
|
105
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
106
|
-
# is attached to the right visitor without any lookup overhead.
|
|
105
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
106
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
107
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
107
108
|
#
|
|
108
109
|
# @return [String, nil]
|
|
109
110
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -128,11 +129,11 @@ module OursprivacyIngest
|
|
|
128
129
|
#
|
|
129
130
|
# @param default_properties [OursprivacyIngest::Models::BatchCreateParams::Event::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
130
131
|
#
|
|
131
|
-
# @param email [String, nil] The email address of a user.
|
|
132
|
+
# @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
|
|
132
133
|
#
|
|
133
134
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
134
135
|
#
|
|
135
|
-
# @param external_id [String, nil] Your system's unique identifier for this user.
|
|
136
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
|
|
136
137
|
#
|
|
137
138
|
# @param identity_context [OursprivacyIngest::Models::BatchCreateParams::Event::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
138
139
|
#
|
|
@@ -4,12 +4,6 @@ module OursprivacyIngest
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see OursprivacyIngest::Resources::Experiments#personalization
|
|
6
6
|
class ExperimentPersonalizationResponse < OursprivacyIngest::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute personalizations
|
|
8
|
-
#
|
|
9
|
-
# @return [Array<OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization>]
|
|
10
|
-
required :personalizations,
|
|
11
|
-
-> { OursprivacyIngest::Internal::Type::ArrayOf[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization] }
|
|
12
|
-
|
|
13
7
|
# @!attribute properties
|
|
14
8
|
# The visitor traits accumulated by your personalization property rules, keyed by
|
|
15
9
|
# property key. Values are always scalars — a string, number, or boolean, or null
|
|
@@ -27,15 +21,49 @@ module OursprivacyIngest
|
|
|
27
21
|
# @return [Boolean, OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success]
|
|
28
22
|
required :success, enum: -> { OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success }
|
|
29
23
|
|
|
30
|
-
# @!
|
|
24
|
+
# @!attribute personalizations
|
|
25
|
+
# @deprecated
|
|
26
|
+
#
|
|
27
|
+
# Deprecated legacy personalization assignments. Current API responses omit this
|
|
28
|
+
# field; use properties for accumulated personalization traits. Retained in the
|
|
29
|
+
# SDK for callers using older responses.
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization>, nil]
|
|
32
|
+
optional :personalizations,
|
|
33
|
+
-> { OursprivacyIngest::Internal::Type::ArrayOf[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization] }
|
|
34
|
+
|
|
35
|
+
# @!method initialize(properties:, success:, personalizations: nil)
|
|
31
36
|
# Some parameter documentations has been truncated, see
|
|
32
37
|
# {OursprivacyIngest::Models::ExperimentPersonalizationResponse} for more details.
|
|
33
38
|
#
|
|
34
|
-
# @param personalizations [Array<OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization>]
|
|
35
|
-
#
|
|
36
39
|
# @param properties [Hash{Symbol=>String, Float, Boolean}] The visitor traits accumulated by your personalization property rules, keyed by
|
|
37
40
|
#
|
|
38
41
|
# @param success [Boolean, OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success]
|
|
42
|
+
#
|
|
43
|
+
# @param personalizations [Array<OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization>] Deprecated legacy personalization assignments. Current API responses omit this f
|
|
44
|
+
|
|
45
|
+
module Property
|
|
46
|
+
extend OursprivacyIngest::Internal::Type::Union
|
|
47
|
+
|
|
48
|
+
variant String
|
|
49
|
+
|
|
50
|
+
variant Float
|
|
51
|
+
|
|
52
|
+
variant OursprivacyIngest::Internal::Type::Boolean
|
|
53
|
+
|
|
54
|
+
# @!method self.variants
|
|
55
|
+
# @return [Array(String, Float, Boolean)]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @see OursprivacyIngest::Models::ExperimentPersonalizationResponse#success
|
|
59
|
+
module Success
|
|
60
|
+
extend OursprivacyIngest::Internal::Type::Enum
|
|
61
|
+
|
|
62
|
+
TRUE = true
|
|
63
|
+
|
|
64
|
+
# @!method self.values
|
|
65
|
+
# @return [Array<Boolean>]
|
|
66
|
+
end
|
|
39
67
|
|
|
40
68
|
class Personalization < OursprivacyIngest::Internal::Type::BaseModel
|
|
41
69
|
# @!attribute assigned_at
|
|
@@ -76,29 +104,6 @@ module OursprivacyIngest
|
|
|
76
104
|
# @param experiment_name [String, nil]
|
|
77
105
|
# @param variant_name [String, nil]
|
|
78
106
|
end
|
|
79
|
-
|
|
80
|
-
module Property
|
|
81
|
-
extend OursprivacyIngest::Internal::Type::Union
|
|
82
|
-
|
|
83
|
-
variant String
|
|
84
|
-
|
|
85
|
-
variant Float
|
|
86
|
-
|
|
87
|
-
variant OursprivacyIngest::Internal::Type::Boolean
|
|
88
|
-
|
|
89
|
-
# @!method self.variants
|
|
90
|
-
# @return [Array(String, Float, Boolean)]
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# @see OursprivacyIngest::Models::ExperimentPersonalizationResponse#success
|
|
94
|
-
module Success
|
|
95
|
-
extend OursprivacyIngest::Internal::Type::Enum
|
|
96
|
-
|
|
97
|
-
TRUE = true
|
|
98
|
-
|
|
99
|
-
# @!method self.values
|
|
100
|
-
# @return [Array<Boolean>]
|
|
101
|
-
end
|
|
102
107
|
end
|
|
103
108
|
end
|
|
104
109
|
end
|
|
@@ -40,9 +40,10 @@ module OursprivacyIngest
|
|
|
40
40
|
optional :distinct_id, String, api_name: :distinctId, nil?: true
|
|
41
41
|
|
|
42
42
|
# @!attribute email
|
|
43
|
-
# The email address of a user.
|
|
44
|
-
#
|
|
45
|
-
#
|
|
43
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
44
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
45
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
46
|
+
# visitor.
|
|
46
47
|
#
|
|
47
48
|
# @return [String, nil]
|
|
48
49
|
optional :email, String, nil?: true
|
|
@@ -57,11 +58,11 @@ module OursprivacyIngest
|
|
|
57
58
|
nil?: true
|
|
58
59
|
|
|
59
60
|
# @!attribute external_id
|
|
60
|
-
# Your system's unique identifier for this user.
|
|
61
|
-
# existing visitor with this externalId
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#
|
|
61
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
62
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
63
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
64
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
65
|
+
# removes the lookup round-trip.
|
|
65
66
|
#
|
|
66
67
|
# @return [String, nil]
|
|
67
68
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -86,9 +87,9 @@ module OursprivacyIngest
|
|
|
86
87
|
|
|
87
88
|
# @!attribute user_id
|
|
88
89
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
89
|
-
# When present, this is used directly — no lookup by externalId or
|
|
90
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
91
|
-
# is attached to the right visitor without any lookup overhead.
|
|
90
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
91
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
92
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
92
93
|
#
|
|
93
94
|
# @return [String, nil]
|
|
94
95
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -115,11 +116,11 @@ module OursprivacyIngest
|
|
|
115
116
|
#
|
|
116
117
|
# @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
|
|
117
118
|
#
|
|
118
|
-
# @param email [String, nil] The email address of a user.
|
|
119
|
+
# @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
|
|
119
120
|
#
|
|
120
121
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
121
122
|
#
|
|
122
|
-
# @param external_id [String, nil] Your system's unique identifier for this user.
|
|
123
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
|
|
123
124
|
#
|
|
124
125
|
# @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
125
126
|
#
|
|
@@ -34,19 +34,20 @@ module OursprivacyIngest
|
|
|
34
34
|
nil?: true
|
|
35
35
|
|
|
36
36
|
# @!attribute email
|
|
37
|
-
# The email address of a user.
|
|
38
|
-
#
|
|
39
|
-
#
|
|
37
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
38
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
39
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
40
|
+
# visitor.
|
|
40
41
|
#
|
|
41
42
|
# @return [String, nil]
|
|
42
43
|
optional :email, String, nil?: true
|
|
43
44
|
|
|
44
45
|
# @!attribute external_id
|
|
45
|
-
# Your system's unique identifier for this user.
|
|
46
|
-
# existing visitor with this externalId
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
46
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
47
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
48
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
49
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
50
|
+
# removes the lookup round-trip.
|
|
50
51
|
#
|
|
51
52
|
# @return [String, nil]
|
|
52
53
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -64,9 +65,9 @@ module OursprivacyIngest
|
|
|
64
65
|
|
|
65
66
|
# @!attribute user_id
|
|
66
67
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
67
|
-
# When present, this is used directly — no lookup by externalId or
|
|
68
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
69
|
-
# is attached to the right visitor without any lookup overhead.
|
|
68
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
69
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
70
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
70
71
|
#
|
|
71
72
|
# @return [String, nil]
|
|
72
73
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -81,9 +82,9 @@ module OursprivacyIngest
|
|
|
81
82
|
#
|
|
82
83
|
# @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
83
84
|
#
|
|
84
|
-
# @param email [String, nil] The email address of a user.
|
|
85
|
+
# @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
|
|
85
86
|
#
|
|
86
|
-
# @param external_id [String, nil] Your system's unique identifier for this user.
|
|
87
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
|
|
87
88
|
#
|
|
88
89
|
# @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
89
90
|
#
|
|
@@ -51,13 +51,10 @@ module OursprivacyIngest
|
|
|
51
51
|
)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# Return
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
# personalization property rules have accumulated, ready to use in server-rendered
|
|
59
|
-
# copy or targeting. Both are empty for a visitor who has not matched anything
|
|
60
|
-
# yet.
|
|
54
|
+
# Return the visitor traits accumulated by personalization property rules.
|
|
55
|
+
# Read-only and never records an impression. Use the properties to select
|
|
56
|
+
# personalized server-rendered copy or targeting; the browser experiment runtime
|
|
57
|
+
# receives the same bag at initialization.
|
|
61
58
|
#
|
|
62
59
|
# @overload personalization(token:, visitor_id:, request_options: {})
|
|
63
60
|
#
|
|
@@ -6,15 +6,18 @@ 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
|
|
10
|
-
#
|
|
11
|
-
# priority order: userId (direct, no lookup) →
|
|
12
|
-
# email
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
9
|
+
# Track events from your server. Include userId, externalId, email, or
|
|
10
|
+
# userProperties.phone_number to associate the event with an existing visitor.
|
|
11
|
+
# Identity resolution runs in priority order: userId (direct, no lookup) →
|
|
12
|
+
# externalId → email → userProperties.phone_number. Each lookup runs only if
|
|
13
|
+
# earlier identifiers did not resolve a visitor. Phone matching ignores common
|
|
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
|
|
19
|
+
# semantics). See https://docs.oursprivacy.com/docs/data-types for details and
|
|
20
|
+
# common pitfalls.
|
|
18
21
|
#
|
|
19
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: {})
|
|
20
23
|
#
|
|
@@ -26,11 +29,11 @@ module OursprivacyIngest
|
|
|
26
29
|
#
|
|
27
30
|
# @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
|
|
28
31
|
#
|
|
29
|
-
# @param email [String, nil] The email address of a user.
|
|
32
|
+
# @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
|
|
30
33
|
#
|
|
31
34
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
32
35
|
#
|
|
33
|
-
# @param external_id [String, nil] Your system's unique identifier for this user.
|
|
36
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
|
|
34
37
|
#
|
|
35
38
|
# @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
36
39
|
#
|
|
@@ -9,13 +9,16 @@ module OursprivacyIngest
|
|
|
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
11
|
# event stream. Identity resolution runs in priority order: userId (direct, no
|
|
12
|
-
# lookup) → externalId
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
12
|
+
# lookup) → externalId → email → userProperties.phone_number. Each lookup runs
|
|
13
|
+
# only if earlier identifiers did not resolve a visitor. Phone matching ignores
|
|
14
|
+
# common formatting and an international + or 00 prefix, but does not infer a
|
|
15
|
+
# country code. When a visitor is found, their Ours Visitor ID is used going
|
|
16
|
+
# forward so all future events are attached to the same profile. For top-level
|
|
17
|
+
# visitor properties: null clears the existing value, while undefined, omitted
|
|
18
|
+
# fields, and empty strings are ignored. For entries inside custom_properties:
|
|
19
|
+
# null, undefined, and empty strings are all ignored (custom_properties use merge
|
|
20
|
+
# semantics). See https://docs.oursprivacy.com/docs/data-types for details and
|
|
21
|
+
# common pitfalls.
|
|
19
22
|
#
|
|
20
23
|
# @overload upsert(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, request_options: {})
|
|
21
24
|
#
|
|
@@ -25,9 +28,9 @@ module OursprivacyIngest
|
|
|
25
28
|
#
|
|
26
29
|
# @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
27
30
|
#
|
|
28
|
-
# @param email [String, nil] The email address of a user.
|
|
31
|
+
# @param email [String, nil] The email address of a user. When userId is absent and externalId does not resol
|
|
29
32
|
#
|
|
30
|
-
# @param external_id [String, nil] Your system's unique identifier for this user.
|
|
33
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. When userId is absent, we search
|
|
31
34
|
#
|
|
32
35
|
# @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
33
36
|
#
|
|
@@ -92,9 +92,10 @@ module OursprivacyIngest
|
|
|
92
92
|
end
|
|
93
93
|
attr_writer :default_properties
|
|
94
94
|
|
|
95
|
-
# The email address of a user.
|
|
96
|
-
#
|
|
97
|
-
#
|
|
95
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
96
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
97
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
98
|
+
# visitor.
|
|
98
99
|
sig { returns(T.nilable(String)) }
|
|
99
100
|
attr_accessor :email
|
|
100
101
|
|
|
@@ -102,11 +103,11 @@ module OursprivacyIngest
|
|
|
102
103
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
|
|
103
104
|
attr_accessor :event_properties
|
|
104
105
|
|
|
105
|
-
# Your system's unique identifier for this user.
|
|
106
|
-
# existing visitor with this externalId
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
#
|
|
106
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
107
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
108
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
109
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
110
|
+
# removes the lookup round-trip.
|
|
110
111
|
sig { returns(T.nilable(String)) }
|
|
111
112
|
attr_accessor :external_id
|
|
112
113
|
|
|
@@ -138,9 +139,9 @@ module OursprivacyIngest
|
|
|
138
139
|
attr_accessor :time
|
|
139
140
|
|
|
140
141
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
141
|
-
# When present, this is used directly — no lookup by externalId or
|
|
142
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
143
|
-
# is attached to the right visitor without any lookup overhead.
|
|
142
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
143
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
144
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
144
145
|
sig { returns(T.nilable(String)) }
|
|
145
146
|
attr_accessor :user_id
|
|
146
147
|
|
|
@@ -200,17 +201,18 @@ module OursprivacyIngest
|
|
|
200
201
|
# These properties are used throughout the Ours app to pass known values onto
|
|
201
202
|
# destinations
|
|
202
203
|
default_properties: nil,
|
|
203
|
-
# The email address of a user.
|
|
204
|
-
#
|
|
205
|
-
#
|
|
204
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
205
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
206
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
207
|
+
# visitor.
|
|
206
208
|
email: nil,
|
|
207
209
|
# Any additional event properties you want to pass along.
|
|
208
210
|
event_properties: nil,
|
|
209
|
-
# Your system's unique identifier for this user.
|
|
210
|
-
# existing visitor with this externalId
|
|
211
|
-
#
|
|
212
|
-
#
|
|
213
|
-
#
|
|
211
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
212
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
213
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
214
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
215
|
+
# removes the lookup round-trip.
|
|
214
216
|
external_id: nil,
|
|
215
217
|
# End-user network context for server-side calls. Required for probabilistic
|
|
216
218
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -220,9 +222,9 @@ module OursprivacyIngest
|
|
|
220
222
|
# must be in the past and within the last 7 days.
|
|
221
223
|
time: nil,
|
|
222
224
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
223
|
-
# When present, this is used directly — no lookup by externalId or
|
|
224
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
225
|
-
# is attached to the right visitor without any lookup overhead.
|
|
225
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
226
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
227
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
226
228
|
user_id: nil,
|
|
227
229
|
# Properties to set on the visitor. (optional) You can also update these
|
|
228
230
|
# properties via the identify endpoint.
|
|
@@ -11,15 +11,6 @@ module OursprivacyIngest
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
sig do
|
|
15
|
-
returns(
|
|
16
|
-
T::Array[
|
|
17
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization
|
|
18
|
-
]
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
attr_accessor :personalizations
|
|
22
|
-
|
|
23
14
|
# The visitor traits accumulated by your personalization property rules, keyed by
|
|
24
15
|
# property key. Values are always scalars — a string, number, or boolean, or null
|
|
25
16
|
# when the captured field was itself empty. Empty for a visitor who has not
|
|
@@ -43,23 +34,46 @@ module OursprivacyIngest
|
|
|
43
34
|
end
|
|
44
35
|
attr_accessor :success
|
|
45
36
|
|
|
37
|
+
# Deprecated legacy personalization assignments. Current API responses omit this
|
|
38
|
+
# field; use properties for accumulated personalization traits. Retained in the
|
|
39
|
+
# SDK for callers using older responses.
|
|
40
|
+
sig do
|
|
41
|
+
returns(
|
|
42
|
+
T.nilable(
|
|
43
|
+
T::Array[
|
|
44
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization
|
|
45
|
+
]
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
attr_reader :personalizations
|
|
50
|
+
|
|
46
51
|
sig do
|
|
47
52
|
params(
|
|
48
53
|
personalizations:
|
|
49
54
|
T::Array[
|
|
50
55
|
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization::OrHash
|
|
51
|
-
]
|
|
56
|
+
]
|
|
57
|
+
).void
|
|
58
|
+
end
|
|
59
|
+
attr_writer :personalizations
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
params(
|
|
52
63
|
properties:
|
|
53
64
|
T::Hash[
|
|
54
65
|
Symbol,
|
|
55
66
|
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Property::Variants
|
|
56
67
|
],
|
|
57
68
|
success:
|
|
58
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::OrBoolean
|
|
69
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::OrBoolean,
|
|
70
|
+
personalizations:
|
|
71
|
+
T::Array[
|
|
72
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization::OrHash
|
|
73
|
+
]
|
|
59
74
|
).returns(T.attached_class)
|
|
60
75
|
end
|
|
61
76
|
def self.new(
|
|
62
|
-
personalizations:,
|
|
63
77
|
# The visitor traits accumulated by your personalization property rules, keyed by
|
|
64
78
|
# property key. Values are always scalars — a string, number, or boolean, or null
|
|
65
79
|
# when the captured field was itself empty. Empty for a visitor who has not
|
|
@@ -67,30 +81,79 @@ module OursprivacyIngest
|
|
|
67
81
|
# and are readable by anyone who knows the visitor_id, so never accumulate
|
|
68
82
|
# secrets, credentials, PHI, or confidential data into a property.
|
|
69
83
|
properties:,
|
|
70
|
-
success
|
|
84
|
+
success:,
|
|
85
|
+
# Deprecated legacy personalization assignments. Current API responses omit this
|
|
86
|
+
# field; use properties for accumulated personalization traits. Retained in the
|
|
87
|
+
# SDK for callers using older responses.
|
|
88
|
+
personalizations: nil
|
|
71
89
|
)
|
|
72
90
|
end
|
|
73
91
|
|
|
74
92
|
sig do
|
|
75
93
|
override.returns(
|
|
76
94
|
{
|
|
77
|
-
personalizations:
|
|
78
|
-
T::Array[
|
|
79
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization
|
|
80
|
-
],
|
|
81
95
|
properties:
|
|
82
96
|
T::Hash[
|
|
83
97
|
Symbol,
|
|
84
98
|
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Property::Variants
|
|
85
99
|
],
|
|
86
100
|
success:
|
|
87
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean
|
|
101
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean,
|
|
102
|
+
personalizations:
|
|
103
|
+
T::Array[
|
|
104
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization
|
|
105
|
+
]
|
|
88
106
|
}
|
|
89
107
|
)
|
|
90
108
|
end
|
|
91
109
|
def to_hash
|
|
92
110
|
end
|
|
93
111
|
|
|
112
|
+
module Property
|
|
113
|
+
extend OursprivacyIngest::Internal::Type::Union
|
|
114
|
+
|
|
115
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
116
|
+
|
|
117
|
+
sig do
|
|
118
|
+
override.returns(
|
|
119
|
+
T::Array[
|
|
120
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Property::Variants
|
|
121
|
+
]
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
def self.variants
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
module Success
|
|
129
|
+
extend OursprivacyIngest::Internal::Type::Enum
|
|
130
|
+
|
|
131
|
+
TaggedBoolean =
|
|
132
|
+
T.type_alias do
|
|
133
|
+
T.all(
|
|
134
|
+
T::Boolean,
|
|
135
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
OrBoolean = T.type_alias { T::Boolean }
|
|
139
|
+
|
|
140
|
+
TRUE =
|
|
141
|
+
T.let(
|
|
142
|
+
true,
|
|
143
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
sig do
|
|
147
|
+
override.returns(
|
|
148
|
+
T::Array[
|
|
149
|
+
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean
|
|
150
|
+
]
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
def self.values
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
94
157
|
class Personalization < OursprivacyIngest::Internal::Type::BaseModel
|
|
95
158
|
OrHash =
|
|
96
159
|
T.type_alias do
|
|
@@ -153,51 +216,6 @@ module OursprivacyIngest
|
|
|
153
216
|
def to_hash
|
|
154
217
|
end
|
|
155
218
|
end
|
|
156
|
-
|
|
157
|
-
module Property
|
|
158
|
-
extend OursprivacyIngest::Internal::Type::Union
|
|
159
|
-
|
|
160
|
-
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
161
|
-
|
|
162
|
-
sig do
|
|
163
|
-
override.returns(
|
|
164
|
-
T::Array[
|
|
165
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Property::Variants
|
|
166
|
-
]
|
|
167
|
-
)
|
|
168
|
-
end
|
|
169
|
-
def self.variants
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
module Success
|
|
174
|
-
extend OursprivacyIngest::Internal::Type::Enum
|
|
175
|
-
|
|
176
|
-
TaggedBoolean =
|
|
177
|
-
T.type_alias do
|
|
178
|
-
T.all(
|
|
179
|
-
T::Boolean,
|
|
180
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success
|
|
181
|
-
)
|
|
182
|
-
end
|
|
183
|
-
OrBoolean = T.type_alias { T::Boolean }
|
|
184
|
-
|
|
185
|
-
TRUE =
|
|
186
|
-
T.let(
|
|
187
|
-
true,
|
|
188
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
sig do
|
|
192
|
-
override.returns(
|
|
193
|
-
T::Array[
|
|
194
|
-
OursprivacyIngest::Models::ExperimentPersonalizationResponse::Success::TaggedBoolean
|
|
195
|
-
]
|
|
196
|
-
)
|
|
197
|
-
end
|
|
198
|
-
def self.values
|
|
199
|
-
end
|
|
200
|
-
end
|
|
201
219
|
end
|
|
202
220
|
end
|
|
203
221
|
end
|
|
@@ -49,9 +49,10 @@ module OursprivacyIngest
|
|
|
49
49
|
sig { returns(T.nilable(String)) }
|
|
50
50
|
attr_accessor :distinct_id
|
|
51
51
|
|
|
52
|
-
# The email address of a user.
|
|
53
|
-
#
|
|
54
|
-
#
|
|
52
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
53
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
54
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
55
|
+
# visitor.
|
|
55
56
|
sig { returns(T.nilable(String)) }
|
|
56
57
|
attr_accessor :email
|
|
57
58
|
|
|
@@ -59,11 +60,11 @@ module OursprivacyIngest
|
|
|
59
60
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
|
|
60
61
|
attr_accessor :event_properties
|
|
61
62
|
|
|
62
|
-
# Your system's unique identifier for this user.
|
|
63
|
-
# existing visitor with this externalId
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
63
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
64
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
65
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
66
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
67
|
+
# removes the lookup round-trip.
|
|
67
68
|
sig { returns(T.nilable(String)) }
|
|
68
69
|
attr_accessor :external_id
|
|
69
70
|
|
|
@@ -91,9 +92,9 @@ module OursprivacyIngest
|
|
|
91
92
|
attr_accessor :time
|
|
92
93
|
|
|
93
94
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
94
|
-
# When present, this is used directly — no lookup by externalId or
|
|
95
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
96
|
-
# is attached to the right visitor without any lookup overhead.
|
|
95
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
96
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
97
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
97
98
|
sig { returns(T.nilable(String)) }
|
|
98
99
|
attr_accessor :user_id
|
|
99
100
|
|
|
@@ -153,17 +154,18 @@ module OursprivacyIngest
|
|
|
153
154
|
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
154
155
|
# internal order ID).
|
|
155
156
|
distinct_id: nil,
|
|
156
|
-
# The email address of a user.
|
|
157
|
-
#
|
|
158
|
-
#
|
|
157
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
158
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
159
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
160
|
+
# visitor.
|
|
159
161
|
email: nil,
|
|
160
162
|
# Any additional event properties you want to pass along.
|
|
161
163
|
event_properties: nil,
|
|
162
|
-
# Your system's unique identifier for this user.
|
|
163
|
-
# existing visitor with this externalId
|
|
164
|
-
#
|
|
165
|
-
#
|
|
166
|
-
#
|
|
164
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
165
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
166
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
167
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
168
|
+
# removes the lookup round-trip.
|
|
167
169
|
external_id: nil,
|
|
168
170
|
# End-user network context for server-side calls. Required for probabilistic
|
|
169
171
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -173,9 +175,9 @@ module OursprivacyIngest
|
|
|
173
175
|
# must be in the past and within the last 7 days.
|
|
174
176
|
time: nil,
|
|
175
177
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
176
|
-
# When present, this is used directly — no lookup by externalId or
|
|
177
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
178
|
-
# is attached to the right visitor without any lookup overhead.
|
|
178
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
179
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
180
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
179
181
|
user_id: nil,
|
|
180
182
|
# Properties to set on the visitor. (optional) You can also update these
|
|
181
183
|
# properties via the identify endpoint.
|
|
@@ -51,17 +51,18 @@ module OursprivacyIngest
|
|
|
51
51
|
end
|
|
52
52
|
attr_writer :default_properties
|
|
53
53
|
|
|
54
|
-
# The email address of a user.
|
|
55
|
-
#
|
|
56
|
-
#
|
|
54
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
55
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
56
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
57
|
+
# visitor.
|
|
57
58
|
sig { returns(T.nilable(String)) }
|
|
58
59
|
attr_accessor :email
|
|
59
60
|
|
|
60
|
-
# Your system's unique identifier for this user.
|
|
61
|
-
# existing visitor with this externalId
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#
|
|
61
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
62
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
63
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
64
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
65
|
+
# removes the lookup round-trip.
|
|
65
66
|
sig { returns(T.nilable(String)) }
|
|
66
67
|
attr_accessor :external_id
|
|
67
68
|
|
|
@@ -86,9 +87,9 @@ module OursprivacyIngest
|
|
|
86
87
|
attr_writer :identity_context
|
|
87
88
|
|
|
88
89
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
89
|
-
# When present, this is used directly — no lookup by externalId or
|
|
90
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
91
|
-
# is attached to the right visitor without any lookup overhead.
|
|
90
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
91
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
92
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
92
93
|
sig { returns(T.nilable(String)) }
|
|
93
94
|
attr_accessor :user_id
|
|
94
95
|
|
|
@@ -121,24 +122,25 @@ module OursprivacyIngest
|
|
|
121
122
|
# These properties are used throughout the Ours app to pass known values onto
|
|
122
123
|
# destinations
|
|
123
124
|
default_properties: nil,
|
|
124
|
-
# The email address of a user.
|
|
125
|
-
#
|
|
126
|
-
#
|
|
125
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
126
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
127
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
128
|
+
# visitor.
|
|
127
129
|
email: nil,
|
|
128
|
-
# Your system's unique identifier for this user.
|
|
129
|
-
# existing visitor with this externalId
|
|
130
|
-
#
|
|
131
|
-
#
|
|
132
|
-
#
|
|
130
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
131
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
132
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
133
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
134
|
+
# removes the lookup round-trip.
|
|
133
135
|
external_id: nil,
|
|
134
136
|
# End-user network context for server-side calls. Required for probabilistic
|
|
135
137
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
136
138
|
# browser.
|
|
137
139
|
identity_context: nil,
|
|
138
140
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
139
|
-
# When present, this is used directly — no lookup by externalId or
|
|
140
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
141
|
-
# is attached to the right visitor without any lookup overhead.
|
|
141
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
142
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
143
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
142
144
|
user_id: nil,
|
|
143
145
|
request_options: {}
|
|
144
146
|
)
|
|
@@ -45,13 +45,10 @@ module OursprivacyIngest
|
|
|
45
45
|
)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
# Return
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
# personalization property rules have accumulated, ready to use in server-rendered
|
|
53
|
-
# copy or targeting. Both are empty for a visitor who has not matched anything
|
|
54
|
-
# yet.
|
|
48
|
+
# Return the visitor traits accumulated by personalization property rules.
|
|
49
|
+
# Read-only and never records an impression. Use the properties to select
|
|
50
|
+
# personalized server-rendered copy or targeting; the browser experiment runtime
|
|
51
|
+
# receives the same bag at initialization.
|
|
55
52
|
sig do
|
|
56
53
|
params(
|
|
57
54
|
token: String,
|
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
module OursprivacyIngest
|
|
4
4
|
module Resources
|
|
5
5
|
class Track
|
|
6
|
-
# Track events from your server. Include
|
|
7
|
-
#
|
|
8
|
-
# priority order: userId (direct, no lookup) →
|
|
9
|
-
# email
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
6
|
+
# Track events from your server. Include userId, externalId, email, or
|
|
7
|
+
# userProperties.phone_number to associate the event with an existing visitor.
|
|
8
|
+
# Identity resolution runs in priority order: userId (direct, no lookup) →
|
|
9
|
+
# externalId → email → userProperties.phone_number. Each lookup runs only if
|
|
10
|
+
# earlier identifiers did not resolve a visitor. Phone matching ignores common
|
|
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
|
|
16
|
+
# semantics). See https://docs.oursprivacy.com/docs/data-types for details and
|
|
17
|
+
# common pitfalls.
|
|
15
18
|
sig do
|
|
16
19
|
params(
|
|
17
20
|
token: String,
|
|
@@ -51,17 +54,18 @@ module OursprivacyIngest
|
|
|
51
54
|
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
52
55
|
# internal order ID).
|
|
53
56
|
distinct_id: nil,
|
|
54
|
-
# The email address of a user.
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
58
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
59
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
60
|
+
# visitor.
|
|
57
61
|
email: nil,
|
|
58
62
|
# Any additional event properties you want to pass along.
|
|
59
63
|
event_properties: nil,
|
|
60
|
-
# Your system's unique identifier for this user.
|
|
61
|
-
# existing visitor with this externalId
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#
|
|
64
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
65
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
66
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
67
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
68
|
+
# removes the lookup round-trip.
|
|
65
69
|
external_id: nil,
|
|
66
70
|
# End-user network context for server-side calls. Required for probabilistic
|
|
67
71
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -71,9 +75,9 @@ module OursprivacyIngest
|
|
|
71
75
|
# must be in the past and within the last 7 days.
|
|
72
76
|
time: nil,
|
|
73
77
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
74
|
-
# When present, this is used directly — no lookup by externalId or
|
|
75
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
76
|
-
# is attached to the right visitor without any lookup overhead.
|
|
78
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
79
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
80
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
77
81
|
user_id: nil,
|
|
78
82
|
# Properties to set on the visitor. (optional) You can also update these
|
|
79
83
|
# properties via the identify endpoint.
|
|
@@ -6,13 +6,16 @@ module OursprivacyIngest
|
|
|
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
8
|
# event stream. Identity resolution runs in priority order: userId (direct, no
|
|
9
|
-
# lookup) → externalId
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
9
|
+
# lookup) → externalId → email → userProperties.phone_number. Each lookup runs
|
|
10
|
+
# only if earlier identifiers did not resolve a visitor. Phone matching ignores
|
|
11
|
+
# common formatting and an international + or 00 prefix, but does not infer a
|
|
12
|
+
# country code. When a visitor is found, their Ours Visitor ID is used going
|
|
13
|
+
# forward so all future events are attached to the same profile. For top-level
|
|
14
|
+
# visitor properties: null clears the existing value, while undefined, omitted
|
|
15
|
+
# fields, and empty strings are ignored. For entries inside custom_properties:
|
|
16
|
+
# null, undefined, and empty strings are all ignored (custom_properties use merge
|
|
17
|
+
# semantics). See https://docs.oursprivacy.com/docs/data-types for details and
|
|
18
|
+
# common pitfalls.
|
|
16
19
|
sig do
|
|
17
20
|
params(
|
|
18
21
|
token: String,
|
|
@@ -42,24 +45,25 @@ module OursprivacyIngest
|
|
|
42
45
|
# These properties are used throughout the Ours app to pass known values onto
|
|
43
46
|
# destinations
|
|
44
47
|
default_properties: nil,
|
|
45
|
-
# The email address of a user.
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
+
# The email address of a user. When userId is absent and externalId does not
|
|
49
|
+
# resolve a visitor, we search your account for a visitor with this email. If no
|
|
50
|
+
# match is found, we try userProperties.phone_number before creating a new
|
|
51
|
+
# visitor.
|
|
48
52
|
email: nil,
|
|
49
|
-
# Your system's unique identifier for this user.
|
|
50
|
-
# existing visitor with this externalId
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
53
|
+
# Your system's unique identifier for this user. When userId is absent, we search
|
|
54
|
+
# your account for an existing visitor with this externalId. If no match is found,
|
|
55
|
+
# we try email and then userProperties.phone_number before creating a new visitor.
|
|
56
|
+
# If you also have the userId from cookies or local storage, send both — it
|
|
57
|
+
# removes the lookup round-trip.
|
|
54
58
|
external_id: nil,
|
|
55
59
|
# End-user network context for server-side calls. Required for probabilistic
|
|
56
60
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
57
61
|
# browser.
|
|
58
62
|
identity_context: nil,
|
|
59
63
|
# The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
60
|
-
# When present, this is used directly — no lookup by externalId or
|
|
61
|
-
# performed. If you have both a userId and an externalId, send both so the
|
|
62
|
-
# is attached to the right visitor without any lookup overhead.
|
|
64
|
+
# When present, this is used directly — no lookup by externalId, email, or phone
|
|
65
|
+
# is performed. If you have both a userId and an externalId, send both so the
|
|
66
|
+
# event is attached to the right visitor without any lookup overhead.
|
|
63
67
|
user_id: nil,
|
|
64
68
|
request_options: {}
|
|
65
69
|
)
|
|
@@ -2,30 +2,52 @@ module OursprivacyIngest
|
|
|
2
2
|
module Models
|
|
3
3
|
type experiment_personalization_response =
|
|
4
4
|
{
|
|
5
|
-
personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization],
|
|
6
5
|
properties: ::Hash[Symbol, OursprivacyIngest::Models::ExperimentPersonalizationResponse::property],
|
|
7
|
-
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success
|
|
6
|
+
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success,
|
|
7
|
+
personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
class ExperimentPersonalizationResponse < OursprivacyIngest::Internal::Type::BaseModel
|
|
11
|
-
attr_accessor personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
12
|
-
|
|
13
11
|
attr_accessor properties: ::Hash[Symbol, OursprivacyIngest::Models::ExperimentPersonalizationResponse::property]
|
|
14
12
|
|
|
15
13
|
attr_accessor success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success
|
|
16
14
|
|
|
15
|
+
attr_reader personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]?
|
|
16
|
+
|
|
17
|
+
def personalizations=: (
|
|
18
|
+
::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
19
|
+
) -> ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
20
|
+
|
|
17
21
|
def initialize: (
|
|
18
|
-
personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization],
|
|
19
22
|
properties: ::Hash[Symbol, OursprivacyIngest::Models::ExperimentPersonalizationResponse::property],
|
|
20
|
-
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success
|
|
23
|
+
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success,
|
|
24
|
+
?personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
21
25
|
) -> void
|
|
22
26
|
|
|
23
27
|
def to_hash: -> {
|
|
24
|
-
personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization],
|
|
25
28
|
properties: ::Hash[Symbol, OursprivacyIngest::Models::ExperimentPersonalizationResponse::property],
|
|
26
|
-
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success
|
|
29
|
+
success: OursprivacyIngest::Models::ExperimentPersonalizationResponse::success,
|
|
30
|
+
personalizations: ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::Personalization]
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
type property = String | Float | bool
|
|
34
|
+
|
|
35
|
+
module Property
|
|
36
|
+
extend OursprivacyIngest::Internal::Type::Union
|
|
37
|
+
|
|
38
|
+
def self?.variants: -> ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::property]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
type success = true
|
|
42
|
+
|
|
43
|
+
module Success
|
|
44
|
+
extend OursprivacyIngest::Internal::Type::Enum
|
|
45
|
+
|
|
46
|
+
TRUE: true
|
|
47
|
+
|
|
48
|
+
def self?.values: -> ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::success]
|
|
49
|
+
end
|
|
50
|
+
|
|
29
51
|
type personalization =
|
|
30
52
|
{
|
|
31
53
|
assigned_at: Float,
|
|
@@ -67,24 +89,6 @@ module OursprivacyIngest
|
|
|
67
89
|
variant_name: String?
|
|
68
90
|
}
|
|
69
91
|
end
|
|
70
|
-
|
|
71
|
-
type property = String | Float | bool
|
|
72
|
-
|
|
73
|
-
module Property
|
|
74
|
-
extend OursprivacyIngest::Internal::Type::Union
|
|
75
|
-
|
|
76
|
-
def self?.variants: -> ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::property]
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
type success = true
|
|
80
|
-
|
|
81
|
-
module Success
|
|
82
|
-
extend OursprivacyIngest::Internal::Type::Enum
|
|
83
|
-
|
|
84
|
-
TRUE: true
|
|
85
|
-
|
|
86
|
-
def self?.values: -> ::Array[OursprivacyIngest::Models::ExperimentPersonalizationResponse::success]
|
|
87
|
-
end
|
|
88
92
|
end
|
|
89
93
|
end
|
|
90
94
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oursprivacy-ingest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.20.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ours Privacy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|