Class: HubSpotSDK::Models::Cms::AttentionSpanEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/hubspot_sdk/models/cms/attention_span_event.rb

Overview

Defined Under Namespace

Modules: ExternalPlayContext, MediaType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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(contact_id:, media_bridge_id:, media_bridge_object_coordinates:, media_bridge_object_type_id:, media_name:, media_type:, occurred_timestamp:, percent_range:, portal_id:, provider_id:, session_id:, total_percent_played:, external_play_context: nil, media_url: nil, page_id: nil, page_name: nil, page_object_coordinates: nil, page_url: nil, raw_data: nil, total_seconds_played: nil) ⇒ Object

Some parameter documentations has been truncated, see HubSpotSDK::Models::Cms::AttentionSpanEvent for more details.

Parameters:

  • contact_id (Integer)

    The ID of the contact in HubSpot’s system that consumed the media. This can be f

  • media_bridge_id (Integer)
  • media_bridge_object_coordinates (String)
  • media_bridge_object_type_id (String)
  • media_name (String)
  • media_type (Symbol, HubSpotSDK::Models::Cms::AttentionSpanEvent::MediaType)
  • occurred_timestamp (Integer)

    The timestamp at which this event occurred, in milliseconds since the epoch.

  • percent_range (String)
  • portal_id (Integer)

    The ID of the HubSpot account.

  • provider_id (Integer)
  • session_id (String)
  • total_percent_played (Float)

    The percent of the media that the user consumed. Providers may calculate this di

  • external_play_context (Symbol, HubSpotSDK::Models::Cms::AttentionSpanEvent::ExternalPlayContext) (defaults to: nil)
  • media_url (String) (defaults to: nil)
  • page_id (Integer) (defaults to: nil)

    The ID of the page, if hosted on HubSpot. Required for HubSpot pages.

  • page_name (String) (defaults to: nil)

    The name of the page. Required if the page is not hosted on HubSpot.

  • page_object_coordinates (String) (defaults to: nil)
  • page_url (String) (defaults to: nil)

    The URL of the page that an event happened on. Required if the page is not hoste

  • raw_data (String) (defaults to: nil)

    This is the raw data which provides the most granular data about spans of the me

  • total_seconds_played (Integer) (defaults to: nil)

    The seconds that a user spent consuming the media. The media bridge calculates t



# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 140

Instance Attribute Details

#contact_idInteger

The ID of the contact in HubSpot’s system that consumed the media. This can be fetched using HubSpot’s Get contact by usertoken (utk) API. The API also supports supplying a usertoken, and will handle converting this into a contact ID automatically.

Returns:

  • (Integer)


15
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 15

required :contact_id, Integer, api_name: :contactId

#external_play_contextSymbol, ...



87
88
89
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 87

optional :external_play_context,
enum: -> { HubSpotSDK::Cms::AttentionSpanEvent::ExternalPlayContext },
api_name: :externalPlayContext

#media_bridge_idInteger

Returns:

  • (Integer)


20
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 20

required :media_bridge_id, Integer, api_name: :mediaBridgeId

#media_bridge_object_coordinatesString

Returns:

  • (String)


25
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 25

required :media_bridge_object_coordinates, String, api_name: :mediaBridgeObjectCoordinates

#media_bridge_object_type_idString

Returns:

  • (String)


30
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 30

required :media_bridge_object_type_id, String, api_name: :mediaBridgeObjectTypeId

#media_nameString

Returns:

  • (String)


35
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 35

required :media_name, String, api_name: :mediaName

#media_typeSymbol, HubSpotSDK::Models::Cms::AttentionSpanEvent::MediaType



40
41
42
43
44
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 40

required :media_type,
enum: -> {
  HubSpotSDK::Cms::AttentionSpanEvent::MediaType
},
api_name: :mediaType

#media_urlString?

Returns:

  • (String, nil)


94
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 94

optional :media_url, String, api_name: :mediaUrl

#occurred_timestampInteger

The timestamp at which this event occurred, in milliseconds since the epoch.

Returns:

  • (Integer)


50
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 50

required :occurred_timestamp, Integer, api_name: :occurredTimestamp

#page_idInteger?

The ID of the page, if hosted on HubSpot. Required for HubSpot pages.

Returns:

  • (Integer, nil)


100
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 100

optional :page_id, Integer, api_name: :pageId

#page_nameString?

The name of the page. Required if the page is not hosted on HubSpot.

Returns:

  • (String, nil)


106
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 106

optional :page_name, String, api_name: :pageName

#page_object_coordinatesString?

Returns:

  • (String, nil)


111
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 111

optional :page_object_coordinates, String, api_name: :pageObjectCoordinates

#page_urlString?

The URL of the page that an event happened on. Required if the page is not hosted on HubSpot.

Returns:

  • (String, nil)


118
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 118

optional :page_url, String, api_name: :pageUrl

#percent_rangeString

Returns:

  • (String)


55
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 55

required :percent_range, String, api_name: :percentRange

#portal_idInteger

The ID of the HubSpot account.

Returns:

  • (Integer)


61
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 61

required :portal_id, Integer, api_name: :portalId

#provider_idInteger

Returns:

  • (Integer)


66
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 66

required :provider_id, Integer, api_name: :providerId

#raw_dataString?

This is the raw data which provides the most granular data about spans of the media, and how many times each span was consumed by the user. For example, for a 10 second video where each second is a span, if a visitor watches the first 5 seconds of the video, then restarts the video and watches the first 2 seconds again, the resulting ‘rawDataString` would be `“0=2;1=2;2=1;3=1;4=1;5=0;6=0;7=0;8=0;9=0;”`.

Returns:

  • (String, nil)


129
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 129

optional :raw_data, String, api_name: :rawData

#session_idString

Returns:

  • (String)


71
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 71

required :session_id, String, api_name: :sessionId

#total_percent_playedFloat

The percent of the media that the user consumed. Providers may calculate this differently depending on how they consider repeated views of the same portion of media. For this reason, the API will not attempt to validate totalPercentWatched against the attention span information for the event. If it is missing, HubSpot will calculate this from the attention span map as follows: (number of spans with a value of 1 or more)/(Total number of spans).

Returns:

  • (Float)


82
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 82

required :total_percent_played, Float, api_name: :totalPercentPlayed

#total_seconds_playedInteger?

The seconds that a user spent consuming the media. The media bridge calculates this as ‘totalPercentPlayed`*`mediaDuration`. If a provider would like this to be calculated differently, they can provide the pre-calculated value when they create the event.

Returns:

  • (Integer, nil)


138
# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 138

optional :total_seconds_played, Integer, api_name: :totalSecondsPlayed

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/hubspot_sdk/models/cms/attention_span_event.rb', line 194