Skip to content

Adds video attention time tracking function to videos service#254

Merged
SHession merged 3 commits into
mainfrom
sh/add-video-attention-tracking-function-to-videos-service
Jun 3, 2026
Merged

Adds video attention time tracking function to videos service#254
SHession merged 3 commits into
mainfrom
sh/add-video-attention-tracking-function-to-videos-service

Conversation

@SHession
Copy link
Copy Markdown
Contributor

@SHession SHession commented Jun 2, 2026

What does this change?

As discussed with @abeddow91, @owenmp and @EnochHankombo92. This changes adds a new function the videos service which will allow DCAR video attention time updates to be sent via Bridget to Ophan. This is consistent with the approach take to submit video media events to Ophan via Bridget.

Related: https://github.com/guardian/dotcom-rendering/blob/ef940ab2214794820992a3a181ce3c2d27340ef4/dotcom-rendering/src/lib/useVideoAttentionTracking.ts#L99-L103

How has this change been tested?

Not tested, open to suggestions?

@SHession SHession requested review from a team as code owners June 2, 2026 08:48
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

🦋 Changeset detected

Latest commit: 14b8960

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/bridget Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@SHession SHession added the feature Departmental tracking: work on a new feature label Jun 2, 2026
Comment thread thrift/native.thrift Outdated
/*
* This method is used to submit component attention time tracking updates for videos from the web layer.
* */
void sendVideoAttentionTime(1:map<string, i64> componentAttentionMs),
Copy link
Copy Markdown
Contributor

@abeddow91 abeddow91 Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this typed as a map so that we can send attention times for multiple videos?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, it's set up to match what Ophan is expecting. We could alternatively take just a single component id and ms value as arguments.

https://github.com/guardian/ophan/blob/bf636f2c3030d7e45a5cb052edb2b6b97a4824ef/event-model/src/main/thrift/event.thrift#L390-L394

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah i see, i think its fine to leave it as it is.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Thrift API method on the Videos service to allow the web layer (via Bridget) to send DCAR video attention-time updates to Ophan, aligning with existing video media event tracking patterns.

Changes:

  • Added sendVideoAttentionTime(1:map<string, i64> ...) to the Videos service in thrift/native.thrift.
  • Added/updated inline service documentation comments for the video tracking methods in the IDL.
  • Added a Changesets entry to publish a minor version bump for @guardian/bridget.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
thrift/native.thrift Extends the Videos Thrift service with a new attention-time tracking method and associated documentation.
.changeset/lovely-words-rule.md Declares a minor release for @guardian/bridget to ship the new API surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread thrift/native.thrift Outdated
Comment thread thrift/native.thrift Outdated
@SHession SHession force-pushed the sh/add-video-attention-tracking-function-to-videos-service branch from ebd559b to c12e0fd Compare June 2, 2026 15:50
@SHession SHession merged commit cfcb63b into main Jun 3, 2026
4 checks passed
@SHession SHession deleted the sh/add-video-attention-tracking-function-to-videos-service branch June 3, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants