Skip to Content

Using Segment together with TwentyThree

TwentyThree makes it easy to send your data to Google Analytics, Hubspot, Marketo (and lots of other integrations). There's even a solution if you want to share video playback and conversion data with a tool not on our list of connections: Segment. Once you've connected TwentyThree to your Segment account, data is transformed and routed to all the Segment integrations you have enabled.

The connection follows the usual video tracking patterns suggested by Segment, but also tracks Video Loaded and Video Converted events along with identity.

Connect to Segment

Before getting started, make sure that you have set up a Segment account and configured a source. Then find Segment's API Write Key for the source.

With this key in hand:

  • Go to Video Attribution → Connect.
  • Click the Segment icon.
  • Paste the write key, and click save. That's it.

Data in Segment

When connected TwentyThree feeds four different kinds of data to Segment from the player:

  • An identify events whenever a user converts using a TwentyThree collector—to submit email address, name, title or similar.
  • A track event for Video Loaded.
  • A track event for Video Played.
  • A track event for Video Paused.
  • A track event for Video Finished.
  • A track event for Video Converted.

In addition to this, pages hosted on TwentyThree are automatically tracked as page views.

Payload example: Identify

analytics.identify('b62aab94-8cc8-02a1-bd19-e304fd7832e6', {
  email:'deathcab@twentythree.com',
  firstname:'Sample',
  lastname:'User',
  company:'TwentyThree',
  object: '4722889'
});

Payload example: Video Loaded

analytics.track('Video Loaded', {
  id: '4722889',
  video: 'Death Cab for Cutie - Unobstructed Views',
  duration: 220,
  category: 'Death Cab For Cutie',
  domain: 'sample.twentythree.com',
  link: 'http://sample.twentythree.com/death-cab-for-cutie',
  streamType: 'ondemand',
  tags: ['death cab for cutie', 'reach'],
  viewer_uuid: 'b62aab94-8cc8-02a1-bd19-e304fd7832e6'
});

Payload example: Video Played

analytics.track('Video Played', {
  id: '4722889',
  name: 'Death Cab for Cutie - Unobstructed Views',
  duration: 220,
  category: 'Death Cab For Cutie',
  domain: 'sample.twentythree.com',
  link: 'http://sample.twentythree.com/death-cab-for-cutie',
  streamType: 'ondemand',
  tags: ['death cab for cutie', 'reach'],
  viewer_uuid: 'b62aab94-8cc8-02a1-bd19-e304fd7832e6'
});

Payload example: Video Paused

analytics.track('Video Paused', {
  id: '4722889',
  name: 'Death Cab for Cutie - Unobstructed Views',
  duration: 220,
  pausedAt: 10.3,
  category: 'Death Cab For Cutie',
  domain: 'sample.twentythree.com',
  link: 'http://sample.twentythree.com/death-cab-for-cutie',
  streamType: 'ondemand',
  tags: ['death cab for cutie', 'reach'],
  viewer_uuid: 'b62aab94-8cc8-02a1-bd19-e304fd7832e6'
});

Payload example: Video Finished

analytics.track('Video Finished', {
  id: '4722889',
  name: 'Death Cab for Cutie - Unobstructed Views',
  duration: 220,
  category: 'Death Cab For Cutie',
  domain: 'sample.twentythree.com',
  link: 'http://sample.twentythree.com/death-cab-for-cutie',
  streamType: 'ondemand',
  tags: ['death cab for cutie', 'reach'],
  viewer_uuid: 'b62aab94-8cc8-02a1-bd19-e304fd7832e6'
});

Payload example: Video Converted

analytics.track('Video Converted', {
  id: '4722889',
  video: 'Death Cab for Cutie - Unobstructed Views',
  duration: 220,
  email:'deathcab@twentythree.com',
  firstname:'Sample',
  lastname:'User',
  company:'TwentyThree',
  category: 'Death Cab For Cutie',
  domain: 'sample.twentythree.com',
  link: 'http://sample.twentythree.com/death-cab-for-cutie',
  streamType: 'ondemand',
  tags: ['death cab for cutie', 'reach'],
  collector_id: 123,
  collector_name: "Video campaign",
  viewer_uuid: 'b62aab94-8cc8-02a1-bd19-e304fd7832e6'
});