Class: OursprivacyIngest::Models::TrackEventParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/oursprivacy_ingest/models/track_event_params.rb,
sig/oursprivacy_ingest/models/track_event_params.rbs

Overview

See Also:

  • OursprivacyIngest::Resources::Track#event

Defined Under Namespace

Classes: DefaultProperties, IdentityContext, UserProperties

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::OursprivacyIngest

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(ip:, user_agent:) ⇒ Object

End-user network context for server-side calls. Required for probabilistic identity resolution when the caller is a backend server rather than an end-user browser.

Parameters:

  • ip (String) —

    The end-user IP address (not the server IP).

  • user_agent (String) —

    The end-user User-Agent string (not the server UA).



# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 621

Instance Attribute Details

#default_properties ⇒ OursprivacyIngest::Models::TrackEventParams::DefaultProperties?

These properties are used throughout the Ours app to pass known values onto destinations

Parameters:

  • value (OursprivacyIngest::TrackEventParams::DefaultProperties, nil)

Returns:



28
29
30
31
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 28

optional :default_properties,
-> { OursprivacyIngest::TrackEventParams::DefaultProperties },
api_name: :defaultProperties,
nil?: true

#distinct_id ⇒ String?

A unique identifier for this event used for deduplication. Highly recommended — if omitted, Ours will generate one for you, but supplying your own gives you stronger idempotency guarantees (e.g. a Stripe payment intent ID or your internal order ID).

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


40
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 40

optional :distinct_id, String, api_name: :distinctId, nil?: true

#email ⇒ String?

The email address of a user. When userId is absent and externalId does not resolve a visitor, we search your account for a visitor with this email. If no match is found, we try userProperties.phone_number before creating a new visitor.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


49
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 49

optional :email, String, nil?: true

#event ⇒ String

The name of the event you're tracking. This must be whitelisted in the Ours dashboard.

Parameters:

  • value (String)

Returns:

  • (String)


21
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 21

required :event, String

#event_properties ⇒ Hash{Symbol=>String, nil}?

Any additional event properties you want to pass along.

Parameters:

  • value (::Hash[Symbol, String?], nil)

Returns:

  • (Hash{Symbol=>String, nil}, nil)


55
56
57
58
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 55

optional :event_properties,
OursprivacyIngest::Internal::Type::HashOf[String, nil?: true],
api_name: :eventProperties,
nil?: true

#external_id ⇒ String?

Your system's unique identifier for this user. When userId is absent, we search your account for an existing visitor with this externalId. If no match is found, we try email and then userProperties.phone_number before creating a new visitor. If you also have the userId from cookies or local storage, send both — it removes the lookup round-trip.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


68
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 68

optional :external_id, String, api_name: :externalId, nil?: true

#identity_context ⇒ OursprivacyIngest::Models::TrackEventParams::IdentityContext?

End-user network context for server-side calls. Required for probabilistic identity resolution when the caller is a backend server rather than an end-user browser.

Parameters:

  • value (OursprivacyIngest::TrackEventParams::IdentityContext, nil)

Returns:



76
77
78
79
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 76

optional :identity_context,
-> { OursprivacyIngest::TrackEventParams::IdentityContext },
api_name: :identityContext,
nil?: true

#time ⇒ Float?

The time at which the event occurred in milliseconds since UTC epoch. The time must be in the past and within the last 7 days.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


86
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 86

optional :time, Float, nil?: true

#token ⇒ String

The token for your Source. You can find this in the dashboard.

Parameters:

  • value (String)

Returns:

  • (String)


14
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 14

required :token, String

#user_id ⇒ String?

The Ours Visitor ID stored in local storage and cookies on your web properties. When present, this is used directly — no lookup by externalId, email, or phone is performed. If you have both a userId and an externalId, send both so the event is attached to the right visitor without any lookup overhead.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


95
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 95

optional :user_id, String, api_name: :userId, nil?: true

#user_properties ⇒ OursprivacyIngest::Models::TrackEventParams::UserProperties?

Properties to set on the visitor. (optional) You can also update these properties via the identify endpoint.

Parameters:

  • value (OursprivacyIngest::TrackEventParams::UserProperties, nil)

Returns:



102
103
104
105
# File 'lib/oursprivacy_ingest/models/track_event_params.rb', line 102

optional :user_properties,
-> { OursprivacyIngest::TrackEventParams::UserProperties },
api_name: :userProperties,
nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


60
# File 'sig/oursprivacy_ingest/models/track_event_params.rbs', line 60

def to_hash: -> {