oursprivacy-ingest 1.5.0 → 1.6.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 +8 -0
- data/README.md +1 -1
- data/lib/oursprivacy_ingest/models/batch_create_params.rb +20 -14
- data/lib/oursprivacy_ingest/models/track_event_params.rb +20 -14
- data/lib/oursprivacy_ingest/models/visitor_upsert_params.rb +15 -12
- data/lib/oursprivacy_ingest/resources/track.rb +10 -8
- 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 +32 -20
- data/rbi/oursprivacy_ingest/models/track_event_params.rbi +32 -20
- data/rbi/oursprivacy_ingest/models/visitor_upsert_params.rbi +24 -18
- data/rbi/oursprivacy_ingest/resources/track.rbi +22 -14
- data/rbi/oursprivacy_ingest/resources/visitor.rbi +21 -15
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d23eb81e41813ee04947b2d1a04f410bf7b8198b2d958ae79042ca379162e62c
|
|
4
|
+
data.tar.gz: e8a0964d9d45ad11a6a2cc5dd44be08af26382036c5c95e6d6790aacd75f4817
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e933d84b08922ee6f9885e9fadb991b4d237a97ed77be3b2672d1e6e59564b1f15e5f9a761cb572fddb1af0c4ccc393137f9b51eccfe371dc1fe6b0661ab75c
|
|
7
|
+
data.tar.gz: c9575d16b3128719b6aac612889144486685e7894835970a813ccd2258090668507e5e8e50d48dcdfb6bd648d421d6d1b8e2da4bcbeb856bcb9a470bc356f482
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.0 (2026-05-07)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v1.5.0...v1.6.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([c54431d](https://github.com/with-ours/ingest-sdk-ruby/commit/c54431d5d205b735a570afa625a3b8e4bdd8c67d))
|
|
10
|
+
|
|
3
11
|
## 1.5.0 (2026-05-06)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.4.0...v1.5.0](https://github.com/with-ours/ingest-sdk-ruby/compare/v1.4.0...v1.5.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "oursprivacy-ingest", "~> 1.
|
|
20
|
+
gem "oursprivacy-ingest", "~> 1.6.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -29,7 +29,10 @@ module OursprivacyIngest
|
|
|
29
29
|
|
|
30
30
|
class Event < OursprivacyIngest::Internal::Type::BaseModel
|
|
31
31
|
# @!attribute distinct_id
|
|
32
|
-
# A unique identifier for
|
|
32
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
33
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
34
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
35
|
+
# internal order ID).
|
|
33
36
|
#
|
|
34
37
|
# @return [String]
|
|
35
38
|
required :distinct_id, String, api_name: :distinctId
|
|
@@ -52,9 +55,9 @@ module OursprivacyIngest
|
|
|
52
55
|
nil?: true
|
|
53
56
|
|
|
54
57
|
# @!attribute email
|
|
55
|
-
# The email address of a user.
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
59
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
60
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
58
61
|
#
|
|
59
62
|
# @return [String, nil]
|
|
60
63
|
optional :email, String, nil?: true
|
|
@@ -69,9 +72,11 @@ module OursprivacyIngest
|
|
|
69
72
|
nil?: true
|
|
70
73
|
|
|
71
74
|
# @!attribute external_id
|
|
72
|
-
#
|
|
73
|
-
#
|
|
74
|
-
#
|
|
75
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
76
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
77
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
78
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
79
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
75
80
|
#
|
|
76
81
|
# @return [String, nil]
|
|
77
82
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -95,9 +100,10 @@ module OursprivacyIngest
|
|
|
95
100
|
optional :time, Float, nil?: true
|
|
96
101
|
|
|
97
102
|
# @!attribute user_id
|
|
98
|
-
# The Ours
|
|
99
|
-
#
|
|
100
|
-
# externalId
|
|
103
|
+
# 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 email is
|
|
105
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
106
|
+
# is attached to the right visitor without any lookup overhead.
|
|
101
107
|
#
|
|
102
108
|
# @return [String, nil]
|
|
103
109
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -116,23 +122,23 @@ module OursprivacyIngest
|
|
|
116
122
|
# Some parameter documentations has been truncated, see
|
|
117
123
|
# {OursprivacyIngest::Models::BatchCreateParams::Event} for more details.
|
|
118
124
|
#
|
|
119
|
-
# @param distinct_id [String] A unique identifier for
|
|
125
|
+
# @param distinct_id [String] A unique identifier for this event used for deduplication. Highly recommended —
|
|
120
126
|
#
|
|
121
127
|
# @param event [String] The name of the event you're tracking. This must be whitelisted in the Ours dash
|
|
122
128
|
#
|
|
123
129
|
# @param default_properties [OursprivacyIngest::Models::BatchCreateParams::Event::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
124
130
|
#
|
|
125
|
-
# @param email [String, nil] The email address of a user.
|
|
131
|
+
# @param email [String, nil] The email address of a user. Used as a fallback lookup when neither userId nor e
|
|
126
132
|
#
|
|
127
133
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
128
134
|
#
|
|
129
|
-
# @param external_id [String, nil]
|
|
135
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. We search your account for an exi
|
|
130
136
|
#
|
|
131
137
|
# @param identity_context [OursprivacyIngest::Models::BatchCreateParams::Event::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
132
138
|
#
|
|
133
139
|
# @param time [Float, nil] The time at which the event occurred in milliseconds since UTC epoch. The time m
|
|
134
140
|
#
|
|
135
|
-
# @param user_id [String, nil] The Ours
|
|
141
|
+
# @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
136
142
|
#
|
|
137
143
|
# @param user_properties [OursprivacyIngest::Models::BatchCreateParams::Event::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
|
|
138
144
|
|
|
@@ -31,15 +31,18 @@ module OursprivacyIngest
|
|
|
31
31
|
nil?: true
|
|
32
32
|
|
|
33
33
|
# @!attribute distinct_id
|
|
34
|
-
# A unique identifier for
|
|
34
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
35
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
36
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
37
|
+
# internal order ID).
|
|
35
38
|
#
|
|
36
39
|
# @return [String, nil]
|
|
37
40
|
optional :distinct_id, String, api_name: :distinctId, nil?: true
|
|
38
41
|
|
|
39
42
|
# @!attribute email
|
|
40
|
-
# The email address of a user.
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
44
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
45
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
43
46
|
#
|
|
44
47
|
# @return [String, nil]
|
|
45
48
|
optional :email, String, nil?: true
|
|
@@ -54,9 +57,11 @@ module OursprivacyIngest
|
|
|
54
57
|
nil?: true
|
|
55
58
|
|
|
56
59
|
# @!attribute external_id
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
61
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
62
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
63
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
64
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
60
65
|
#
|
|
61
66
|
# @return [String, nil]
|
|
62
67
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -80,9 +85,10 @@ module OursprivacyIngest
|
|
|
80
85
|
optional :time, Float, nil?: true
|
|
81
86
|
|
|
82
87
|
# @!attribute user_id
|
|
83
|
-
# The Ours
|
|
84
|
-
#
|
|
85
|
-
# externalId
|
|
88
|
+
# 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 email is
|
|
90
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
91
|
+
# is attached to the right visitor without any lookup overhead.
|
|
86
92
|
#
|
|
87
93
|
# @return [String, nil]
|
|
88
94
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -107,19 +113,19 @@ module OursprivacyIngest
|
|
|
107
113
|
#
|
|
108
114
|
# @param default_properties [OursprivacyIngest::Models::TrackEventParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
109
115
|
#
|
|
110
|
-
# @param distinct_id [String, nil] A unique identifier for
|
|
116
|
+
# @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
|
|
111
117
|
#
|
|
112
|
-
# @param email [String, nil] The email address of a user.
|
|
118
|
+
# @param email [String, nil] The email address of a user. Used as a fallback lookup when neither userId nor e
|
|
113
119
|
#
|
|
114
120
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
115
121
|
#
|
|
116
|
-
# @param external_id [String, nil]
|
|
122
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. We search your account for an exi
|
|
117
123
|
#
|
|
118
124
|
# @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
119
125
|
#
|
|
120
126
|
# @param time [Float, nil] The time at which the event occurred in milliseconds since UTC epoch. The time m
|
|
121
127
|
#
|
|
122
|
-
# @param user_id [String, nil] The Ours
|
|
128
|
+
# @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
123
129
|
#
|
|
124
130
|
# @param user_properties [OursprivacyIngest::Models::TrackEventParams::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
|
|
125
131
|
#
|
|
@@ -34,17 +34,19 @@ 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. Used as a fallback lookup when neither userId nor
|
|
38
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
39
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
40
40
|
#
|
|
41
41
|
# @return [String, nil]
|
|
42
42
|
optional :email, String, nil?: true
|
|
43
43
|
|
|
44
44
|
# @!attribute external_id
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
45
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
46
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
47
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
48
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
49
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
48
50
|
#
|
|
49
51
|
# @return [String, nil]
|
|
50
52
|
optional :external_id, String, api_name: :externalId, nil?: true
|
|
@@ -61,9 +63,10 @@ module OursprivacyIngest
|
|
|
61
63
|
nil?: true
|
|
62
64
|
|
|
63
65
|
# @!attribute user_id
|
|
64
|
-
# The Ours
|
|
65
|
-
#
|
|
66
|
-
# externalId
|
|
66
|
+
# 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 email is
|
|
68
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
69
|
+
# is attached to the right visitor without any lookup overhead.
|
|
67
70
|
#
|
|
68
71
|
# @return [String, nil]
|
|
69
72
|
optional :user_id, String, api_name: :userId, nil?: true
|
|
@@ -78,13 +81,13 @@ module OursprivacyIngest
|
|
|
78
81
|
#
|
|
79
82
|
# @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
80
83
|
#
|
|
81
|
-
# @param email [String, nil] The email address of a user.
|
|
84
|
+
# @param email [String, nil] The email address of a user. Used as a fallback lookup when neither userId nor e
|
|
82
85
|
#
|
|
83
|
-
# @param external_id [String, nil]
|
|
86
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. We search your account for an exi
|
|
84
87
|
#
|
|
85
88
|
# @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
86
89
|
#
|
|
87
|
-
# @param user_id [String, nil] The Ours
|
|
90
|
+
# @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
88
91
|
#
|
|
89
92
|
# @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}]
|
|
90
93
|
|
|
@@ -6,10 +6,12 @@ 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.
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
9
|
+
# Track events from your server. Include at least one of userId, externalId, or
|
|
10
|
+
# email so the event can be associated with a visitor. Identity resolution runs in
|
|
11
|
+
# priority order: userId (direct, no lookup) → externalId (lookup by your ID) →
|
|
12
|
+
# email (fallback lookup). If you know both userId and externalId, send both. For
|
|
13
|
+
# top-level visitor properties: null clears the existing value, while undefined,
|
|
14
|
+
# omitted fields, and empty strings are ignored. For entries inside
|
|
13
15
|
# custom_properties: null, undefined, and empty strings are all ignored
|
|
14
16
|
# (custom_properties use merge semantics). See
|
|
15
17
|
# https://docs.oursprivacy.com/docs/data-types for details and common pitfalls.
|
|
@@ -22,19 +24,19 @@ module OursprivacyIngest
|
|
|
22
24
|
#
|
|
23
25
|
# @param default_properties [OursprivacyIngest::Models::TrackEventParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
24
26
|
#
|
|
25
|
-
# @param distinct_id [String, nil] A unique identifier for
|
|
27
|
+
# @param distinct_id [String, nil] A unique identifier for this event used for deduplication. Highly recommended —
|
|
26
28
|
#
|
|
27
|
-
# @param email [String, nil] The email address of a user.
|
|
29
|
+
# @param email [String, nil] The email address of a user. Used as a fallback lookup when neither userId nor e
|
|
28
30
|
#
|
|
29
31
|
# @param event_properties [Hash{Symbol=>String, nil}, nil] Any additional event properties you want to pass along.
|
|
30
32
|
#
|
|
31
|
-
# @param external_id [String, nil]
|
|
33
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. We search your account for an exi
|
|
32
34
|
#
|
|
33
35
|
# @param identity_context [OursprivacyIngest::Models::TrackEventParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
34
36
|
#
|
|
35
37
|
# @param time [Float, nil] The time at which the event occurred in milliseconds since UTC epoch. The time m
|
|
36
38
|
#
|
|
37
|
-
# @param user_id [String, nil] The Ours
|
|
39
|
+
# @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
38
40
|
#
|
|
39
41
|
# @param user_properties [OursprivacyIngest::Models::TrackEventParams::UserProperties, nil] Properties to set on the visitor. (optional) You can also update these propertie
|
|
40
42
|
#
|
|
@@ -6,12 +6,15 @@ module OursprivacyIngest
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {OursprivacyIngest::Models::VisitorUpsertParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
# fires a $identify event, making the call visible in the
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
9
|
+
# Set or update properties on an existing visitor, or create a new visitor if no
|
|
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
|
|
12
|
+
# lookup) → externalId (lookup by your ID) → email (fallback lookup). When a
|
|
13
|
+
# visitor is found, their Ours Visitor ID is used going forward so all future
|
|
14
|
+
# events are attached to the same profile. For top-level visitor properties: null
|
|
15
|
+
# clears the existing value, while undefined, omitted fields, and empty strings
|
|
16
|
+
# are ignored. For entries inside custom_properties: null, undefined, and empty
|
|
17
|
+
# strings are all ignored (custom_properties use merge semantics). See
|
|
15
18
|
# https://docs.oursprivacy.com/docs/data-types for details and common pitfalls.
|
|
16
19
|
#
|
|
17
20
|
# @overload upsert(token:, user_properties:, default_properties: nil, email: nil, external_id: nil, identity_context: nil, user_id: nil, request_options: {})
|
|
@@ -22,13 +25,13 @@ module OursprivacyIngest
|
|
|
22
25
|
#
|
|
23
26
|
# @param default_properties [OursprivacyIngest::Models::VisitorUpsertParams::DefaultProperties, nil] These properties are used throughout the Ours app to pass known values onto dest
|
|
24
27
|
#
|
|
25
|
-
# @param email [String, nil] The email address of a user.
|
|
28
|
+
# @param email [String, nil] The email address of a user. Used as a fallback lookup when neither userId nor e
|
|
26
29
|
#
|
|
27
|
-
# @param external_id [String, nil]
|
|
30
|
+
# @param external_id [String, nil] Your system's unique identifier for this user. We search your account for an exi
|
|
28
31
|
#
|
|
29
32
|
# @param identity_context [OursprivacyIngest::Models::VisitorUpsertParams::IdentityContext, nil] End-user network context for server-side calls. Required for probabilistic ident
|
|
30
33
|
#
|
|
31
|
-
# @param user_id [String, nil] The Ours
|
|
34
|
+
# @param user_id [String, nil] The Ours Visitor ID stored in local storage and cookies on your web properties.
|
|
32
35
|
#
|
|
33
36
|
# @param request_options [OursprivacyIngest::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
34
37
|
#
|
|
@@ -59,7 +59,10 @@ module OursprivacyIngest
|
|
|
59
59
|
)
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
# A unique identifier for
|
|
62
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
63
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
64
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
65
|
+
# internal order ID).
|
|
63
66
|
sig { returns(String) }
|
|
64
67
|
attr_accessor :distinct_id
|
|
65
68
|
|
|
@@ -89,9 +92,9 @@ module OursprivacyIngest
|
|
|
89
92
|
end
|
|
90
93
|
attr_writer :default_properties
|
|
91
94
|
|
|
92
|
-
# The email address of a user.
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
96
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
97
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
95
98
|
sig { returns(T.nilable(String)) }
|
|
96
99
|
attr_accessor :email
|
|
97
100
|
|
|
@@ -99,9 +102,11 @@ module OursprivacyIngest
|
|
|
99
102
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
|
|
100
103
|
attr_accessor :event_properties
|
|
101
104
|
|
|
102
|
-
#
|
|
103
|
-
#
|
|
104
|
-
#
|
|
105
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
106
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
107
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
108
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
109
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
105
110
|
sig { returns(T.nilable(String)) }
|
|
106
111
|
attr_accessor :external_id
|
|
107
112
|
|
|
@@ -132,9 +137,10 @@ module OursprivacyIngest
|
|
|
132
137
|
sig { returns(T.nilable(Float)) }
|
|
133
138
|
attr_accessor :time
|
|
134
139
|
|
|
135
|
-
# The Ours
|
|
136
|
-
#
|
|
137
|
-
# externalId
|
|
140
|
+
# 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 email is
|
|
142
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
143
|
+
# is attached to the right visitor without any lookup overhead.
|
|
138
144
|
sig { returns(T.nilable(String)) }
|
|
139
145
|
attr_accessor :user_id
|
|
140
146
|
|
|
@@ -183,7 +189,10 @@ module OursprivacyIngest
|
|
|
183
189
|
).returns(T.attached_class)
|
|
184
190
|
end
|
|
185
191
|
def self.new(
|
|
186
|
-
# A unique identifier for
|
|
192
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
193
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
194
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
195
|
+
# internal order ID).
|
|
187
196
|
distinct_id:,
|
|
188
197
|
# The name of the event you're tracking. This must be whitelisted in the Ours
|
|
189
198
|
# dashboard.
|
|
@@ -191,15 +200,17 @@ module OursprivacyIngest
|
|
|
191
200
|
# These properties are used throughout the Ours app to pass known values onto
|
|
192
201
|
# destinations
|
|
193
202
|
default_properties: nil,
|
|
194
|
-
# The email address of a user.
|
|
195
|
-
#
|
|
196
|
-
#
|
|
203
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
204
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
205
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
197
206
|
email: nil,
|
|
198
207
|
# Any additional event properties you want to pass along.
|
|
199
208
|
event_properties: nil,
|
|
200
|
-
#
|
|
201
|
-
#
|
|
202
|
-
#
|
|
209
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
210
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
211
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
212
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
213
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
203
214
|
external_id: nil,
|
|
204
215
|
# End-user network context for server-side calls. Required for probabilistic
|
|
205
216
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -208,9 +219,10 @@ module OursprivacyIngest
|
|
|
208
219
|
# The time at which the event occurred in milliseconds since UTC epoch. The time
|
|
209
220
|
# must be in the past and within the last 7 days.
|
|
210
221
|
time: nil,
|
|
211
|
-
# The Ours
|
|
212
|
-
#
|
|
213
|
-
# externalId
|
|
222
|
+
# 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 email is
|
|
224
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
225
|
+
# is attached to the right visitor without any lookup overhead.
|
|
214
226
|
user_id: nil,
|
|
215
227
|
# Properties to set on the visitor. (optional) You can also update these
|
|
216
228
|
# properties via the identify endpoint.
|
|
@@ -42,13 +42,16 @@ module OursprivacyIngest
|
|
|
42
42
|
end
|
|
43
43
|
attr_writer :default_properties
|
|
44
44
|
|
|
45
|
-
# A unique identifier for
|
|
45
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
46
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
47
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
48
|
+
# internal order ID).
|
|
46
49
|
sig { returns(T.nilable(String)) }
|
|
47
50
|
attr_accessor :distinct_id
|
|
48
51
|
|
|
49
|
-
# The email address of a user.
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
53
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
54
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
52
55
|
sig { returns(T.nilable(String)) }
|
|
53
56
|
attr_accessor :email
|
|
54
57
|
|
|
@@ -56,9 +59,11 @@ module OursprivacyIngest
|
|
|
56
59
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
|
|
57
60
|
attr_accessor :event_properties
|
|
58
61
|
|
|
59
|
-
#
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
63
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
64
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
65
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
66
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
62
67
|
sig { returns(T.nilable(String)) }
|
|
63
68
|
attr_accessor :external_id
|
|
64
69
|
|
|
@@ -85,9 +90,10 @@ module OursprivacyIngest
|
|
|
85
90
|
sig { returns(T.nilable(Float)) }
|
|
86
91
|
attr_accessor :time
|
|
87
92
|
|
|
88
|
-
# The Ours
|
|
89
|
-
#
|
|
90
|
-
# externalId
|
|
93
|
+
# 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 email is
|
|
95
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
96
|
+
# is attached to the right visitor without any lookup overhead.
|
|
91
97
|
sig { returns(T.nilable(String)) }
|
|
92
98
|
attr_accessor :user_id
|
|
93
99
|
|
|
@@ -142,17 +148,22 @@ module OursprivacyIngest
|
|
|
142
148
|
# These properties are used throughout the Ours app to pass known values onto
|
|
143
149
|
# destinations
|
|
144
150
|
default_properties: nil,
|
|
145
|
-
# A unique identifier for
|
|
151
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
152
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
153
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
154
|
+
# internal order ID).
|
|
146
155
|
distinct_id: nil,
|
|
147
|
-
# The email address of a user.
|
|
148
|
-
#
|
|
149
|
-
#
|
|
156
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
157
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
158
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
150
159
|
email: nil,
|
|
151
160
|
# Any additional event properties you want to pass along.
|
|
152
161
|
event_properties: nil,
|
|
153
|
-
#
|
|
154
|
-
#
|
|
155
|
-
#
|
|
162
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
163
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
164
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
165
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
166
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
156
167
|
external_id: nil,
|
|
157
168
|
# End-user network context for server-side calls. Required for probabilistic
|
|
158
169
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -161,9 +172,10 @@ module OursprivacyIngest
|
|
|
161
172
|
# The time at which the event occurred in milliseconds since UTC epoch. The time
|
|
162
173
|
# must be in the past and within the last 7 days.
|
|
163
174
|
time: nil,
|
|
164
|
-
# The Ours
|
|
165
|
-
#
|
|
166
|
-
# externalId
|
|
175
|
+
# 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 email is
|
|
177
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
178
|
+
# is attached to the right visitor without any lookup overhead.
|
|
167
179
|
user_id: nil,
|
|
168
180
|
# Properties to set on the visitor. (optional) You can also update these
|
|
169
181
|
# properties via the identify endpoint.
|
|
@@ -51,15 +51,17 @@ 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. Used as a fallback lookup when neither userId nor
|
|
55
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
56
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
57
57
|
sig { returns(T.nilable(String)) }
|
|
58
58
|
attr_accessor :email
|
|
59
59
|
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
-
#
|
|
60
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
61
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
62
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
63
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
64
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
63
65
|
sig { returns(T.nilable(String)) }
|
|
64
66
|
attr_accessor :external_id
|
|
65
67
|
|
|
@@ -83,9 +85,10 @@ module OursprivacyIngest
|
|
|
83
85
|
end
|
|
84
86
|
attr_writer :identity_context
|
|
85
87
|
|
|
86
|
-
# The Ours
|
|
87
|
-
#
|
|
88
|
-
# externalId
|
|
88
|
+
# 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 email is
|
|
90
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
91
|
+
# is attached to the right visitor without any lookup overhead.
|
|
89
92
|
sig { returns(T.nilable(String)) }
|
|
90
93
|
attr_accessor :user_id
|
|
91
94
|
|
|
@@ -118,21 +121,24 @@ module OursprivacyIngest
|
|
|
118
121
|
# These properties are used throughout the Ours app to pass known values onto
|
|
119
122
|
# destinations
|
|
120
123
|
default_properties: nil,
|
|
121
|
-
# The email address of a user.
|
|
122
|
-
#
|
|
123
|
-
#
|
|
124
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
125
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
126
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
124
127
|
email: nil,
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
129
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
130
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
131
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
132
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
128
133
|
external_id: nil,
|
|
129
134
|
# End-user network context for server-side calls. Required for probabilistic
|
|
130
135
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
131
136
|
# browser.
|
|
132
137
|
identity_context: nil,
|
|
133
|
-
# The Ours
|
|
134
|
-
#
|
|
135
|
-
# externalId
|
|
138
|
+
# 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 email is
|
|
140
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
141
|
+
# is attached to the right visitor without any lookup overhead.
|
|
136
142
|
user_id: nil,
|
|
137
143
|
request_options: {}
|
|
138
144
|
)
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
module OursprivacyIngest
|
|
4
4
|
module Resources
|
|
5
5
|
class Track
|
|
6
|
-
# Track events from your server.
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
6
|
+
# Track events from your server. Include at least one of userId, externalId, or
|
|
7
|
+
# email so the event can be associated with a visitor. Identity resolution runs in
|
|
8
|
+
# priority order: userId (direct, no lookup) → externalId (lookup by your ID) →
|
|
9
|
+
# email (fallback lookup). If you know both userId and externalId, send both. For
|
|
10
|
+
# top-level visitor properties: null clears the existing value, while undefined,
|
|
11
|
+
# omitted fields, and empty strings are ignored. For entries inside
|
|
10
12
|
# custom_properties: null, undefined, and empty strings are all ignored
|
|
11
13
|
# (custom_properties use merge semantics). See
|
|
12
14
|
# https://docs.oursprivacy.com/docs/data-types for details and common pitfalls.
|
|
@@ -44,17 +46,22 @@ module OursprivacyIngest
|
|
|
44
46
|
# These properties are used throughout the Ours app to pass known values onto
|
|
45
47
|
# destinations
|
|
46
48
|
default_properties: nil,
|
|
47
|
-
# A unique identifier for
|
|
49
|
+
# A unique identifier for this event used for deduplication. Highly recommended —
|
|
50
|
+
# if omitted, Ours will generate one for you, but supplying your own gives you
|
|
51
|
+
# stronger idempotency guarantees (e.g. a Stripe payment intent ID or your
|
|
52
|
+
# internal order ID).
|
|
48
53
|
distinct_id: nil,
|
|
49
|
-
# The email address of a user.
|
|
50
|
-
#
|
|
51
|
-
#
|
|
54
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
55
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
56
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
52
57
|
email: nil,
|
|
53
58
|
# Any additional event properties you want to pass along.
|
|
54
59
|
event_properties: nil,
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
60
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
61
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
62
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
63
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
64
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
58
65
|
external_id: nil,
|
|
59
66
|
# End-user network context for server-side calls. Required for probabilistic
|
|
60
67
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
@@ -63,9 +70,10 @@ module OursprivacyIngest
|
|
|
63
70
|
# The time at which the event occurred in milliseconds since UTC epoch. The time
|
|
64
71
|
# must be in the past and within the last 7 days.
|
|
65
72
|
time: nil,
|
|
66
|
-
# The Ours
|
|
67
|
-
#
|
|
68
|
-
# externalId
|
|
73
|
+
# 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 email is
|
|
75
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
76
|
+
# is attached to the right visitor without any lookup overhead.
|
|
69
77
|
user_id: nil,
|
|
70
78
|
# Properties to set on the visitor. (optional) You can also update these
|
|
71
79
|
# properties via the identify endpoint.
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
module OursprivacyIngest
|
|
4
4
|
module Resources
|
|
5
5
|
class Visitor
|
|
6
|
-
#
|
|
7
|
-
# fires a $identify event, making the call visible in the
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
6
|
+
# Set or update properties on an existing visitor, or create a new visitor if no
|
|
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
|
|
9
|
+
# lookup) → externalId (lookup by your ID) → email (fallback lookup). When a
|
|
10
|
+
# visitor is found, their Ours Visitor ID is used going forward so all future
|
|
11
|
+
# events are attached to the same profile. For top-level visitor properties: null
|
|
12
|
+
# clears the existing value, while undefined, omitted fields, and empty strings
|
|
13
|
+
# are ignored. For entries inside custom_properties: null, undefined, and empty
|
|
14
|
+
# strings are all ignored (custom_properties use merge semantics). See
|
|
12
15
|
# https://docs.oursprivacy.com/docs/data-types for details and common pitfalls.
|
|
13
16
|
sig do
|
|
14
17
|
params(
|
|
@@ -39,21 +42,24 @@ module OursprivacyIngest
|
|
|
39
42
|
# These properties are used throughout the Ours app to pass known values onto
|
|
40
43
|
# destinations
|
|
41
44
|
default_properties: nil,
|
|
42
|
-
# The email address of a user.
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
+
# The email address of a user. Used as a fallback lookup when neither userId nor
|
|
46
|
+
# externalId is provided. We search your account for a visitor with this email and
|
|
47
|
+
# attach the event to them. If no match is found, a new visitor is created.
|
|
45
48
|
email: nil,
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
+
# Your system's unique identifier for this user. We search your account for an
|
|
50
|
+
# existing visitor with this externalId and attach the event to them (resolving to
|
|
51
|
+
# their Ours Visitor ID). If no match is found, a new visitor is created. When
|
|
52
|
+
# present, email lookup is skipped. If you also have the userId from cookies or
|
|
53
|
+
# local storage, send both — it removes the lookup round-trip.
|
|
49
54
|
external_id: nil,
|
|
50
55
|
# End-user network context for server-side calls. Required for probabilistic
|
|
51
56
|
# identity resolution when the caller is a backend server rather than an end-user
|
|
52
57
|
# browser.
|
|
53
58
|
identity_context: nil,
|
|
54
|
-
# The Ours
|
|
55
|
-
#
|
|
56
|
-
# externalId
|
|
59
|
+
# 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 email is
|
|
61
|
+
# performed. If you have both a userId and an externalId, send both so the event
|
|
62
|
+
# is attached to the right visitor without any lookup overhead.
|
|
57
63
|
user_id: nil,
|
|
58
64
|
request_options: {}
|
|
59
65
|
)
|