interaction.sample

note icon


This restricted target is only available to specific accounts.

A randomly generated floating-point number between 0 and 100 assigned to stories and their related engagements by the platform.

All stories that are received by the platform are assigned a random number for this target's value. Any engagements that subsequently arrive for the story will be given the same value for the target as the parent story, as long as the story is present in the hydration cache.

This target allows you to perform 'story-level' sampling of interactions when recording data. You can use this target in to capture a proportion of stories and all engagements on these stories that match the other conditions in your interaction filter. This target is useful when you are looking to record a statistical sample of a large audience.

If you would like to record a sample of engagements at a rate distinct from the parent stories you need to use the fb.sample target.

Examples

By default, PYLON filters against all Facebook topic data. For example, this interaction filter will record every story and engagement on a story that mentions any of three automotive brands:

fb.all.content contains_any "BMW, Honda, Mercedes"

If you start a recording using this filter you will record a large volume of interactions that is likely to exceed your account or identity recording limits.

You can use sampling to record a proportion of this data so that you have a representative sample and stay within your limits:

fb.all.content contains_any "BMW, Honda, Mercedes" 
AND interaction.sample <= 10

Because engagements are given the same sample value as their parent stories this filter will match 10% of stories that mention the three brands, and match all the engagements on these selected stories.

You can use sampling targets just like any other target in your filter. For example, you could specify multiple sampling conditions within one filter:

fb.all.content contains_any "BMW, Honda, Mercedes" 
AND ( 
   (fb.author.country == "Brazil" AND interaction.sample <= 1) 
   OR (fb.author.country == "Argentina" AND interaction.sample <= 2) 
   OR (fb.author.country == "Chile" AND interaction.sample <= 10) 
)

This filter specifies different sampling rates depending on the country of the author. This is a useful technique if you want to make sure you record a large enough audience from each country, making sure a dominant country does not use your entire recording allowance.

Notes

PYLON also offers the fb.sample target. This target allows you to perform 'engagement-level' sampling in your recordings. See the target page for examples.

To learn more about sampling read our best practice guide.

Resource information

Target service: PYLON for Facebook Topic Data

Target object: Interaction

Type: float

Array: No

Interaction filter: Yes

Analysis target: No

Query filter: No

Child analysis target: No