YouTube Comment Hydration

Youtube post data fields are attached to Youtube Comment interactions to allow you to filter and classify Youtube Comments based on parent post attributes.

This guide explains how comment hydration works in the context of Youtube interactions.

How does comment hydration work?

When we receive interactions from the Youtube source:

  1. All Youtube video type interactions are added to our Youtube context cache.
  2. As we receive Youtube comment type interactions, the context cache is checked, based on the Youtube video id, to see if the parent video post is stored. If so, the context builder adds data fields from the parent video post to the comment interaction.
  3. Interactions are passed down the pipeline as normal for filtering.

Context cache

Which posts are cached?

We cache every Youtube video type post we receive.

How long are posts cached?

This varies based on engagement. We evict items from the context cache on a Least Recently Used (LRU) basis. This means that Youtube videos which continue to receive high levels of engagement, long after they were written to the cache, will be persisted as long as they continue to receive engagements.

Example interaction filter

Let's look at an example to explain comment hydration in practice.

If you're looking to analyze comments on videos about cars, or comments mentioning cars, you could use the following CSDL:

youtube.type == "comment" AND
  youtube.content CONTAINS_ANY "car, cars" OR CONTAINS_ANY "car, cars"