Researching Audiences for Content Optimization

One way to improve the effectiveness of an advertising campaign is to tailor content for each target segment of your audience based up on the topics each segment expresses an interest in.

For instance if you are advertising a travel booking website and you're looking to target females between 25 and 34, if you can find which destinations this group is discussing and what it is about these destinations that is driving engagement, then you can tailor your content to have a bigger impact.

This approach is called content optimization.

Typically when researching an audience for content optimization you'll take the following approach:

  • Start with a broad topic such as travel.
  • Record the audience engaging with the topic.
  • For each of your target audience segments, analyze which topics (for example travel destinations) are popular.
  • Examine trending topics in detail to determine:
    • which content is driving this engagement.
    • which related topics (for example aspects about the travel destination) are driving engagement.

With these insights you can look to tailor content to each audience segment.

In this article we'll outline how you can use PYLON to derive insights that can inform a content optimization strategy.

Research for content optimization using PYLON


As a quick reminder, you work with PYLON by:

  • Filtering the stream of data from Facebook to stories and engagements (such as likes and comments) you'd like to analyze. Filtered data is recorded into an index.
  • Classifying the data using your own custom rules to add extra metadata for your use case.
  • Analyzing the data you have recorded to the index.

Specifically when you build a content optimization solution with PYLON you will:

  • define an interaction filter that selects interactions which mention your top-level topic (such as travel).
  • analyze your recorded interactions to reveal which topics are important for your audience.
  • use query filters to segment your audience and examine which content and topics are driving engagement.

Solution overview

To help explain a possible solution let's continue with the travel example. Imagine you are looking to analyze engagement with travel topics to tailor adverts and bring more people to your travel booking site.

Filtering interactions

Firstly you need to define an interaction filter that will capture people engaging with travel.

You could use keywords or topics to create a filter, but for this industry links provide an excellent way to record a focused audience which is engaging with the topic.

This example filter looks for URLs that are from well-known travel magazines, guides, forums, booking sites, and newspaper travel sections.

links.url contains_any "/travel, wanderlust, thetravelmagazine, travelandleisure, travelersdigest, timeout,, nationalgeographic,,,, thrillist,,,,,,,,,, tripadvisor, travbuddy, lonelyplanet, roughguides, frommers, fodors, traveldk, cntraveller, responsibletravel, skyscanner, expedia,,, airbnb,, makemytrip, cheapoair, trivago, orbitz, travelocity"

Notice the filter uses the contains_any operator to inspect the links.url target. This technique allows you to capture interactions based on substrings contained in links, as opposed to exact URLs or domains. For example the first item in the list is '/travel' which will capture any URL with '/travel' in the URL's path.

To keep the filter concise and readable it only includes popular sites in the US. Of course the filter could be extended to cover other audiences if you wish.

When you come to writing a filter for your real-world use case you will need to spend time iterating and testing your filter so it captures the right data to your index. In practice, for this example you would invest time expanding the list of sites you want to match.

Classifying source websites

Before you start recording data from your filter you will want to add classification rules. Classification rules surface and normalize features of interactions for use in your analysis. In this case you could use classification rules to classify types of website where content is being shared from.

These example rules classify sites into five groups; travel magazines, travel guides, forums, booking sites and newspaper travel sections. "Magazine" { links.url any "wanderlust, thetravelmagazine, travelandleisure, travelersdigest, timeout,, nationalgeographic,,,, thrillist" } "Newspaper" { links.url any ",,,,,,,,,,,,,," } "Forum" { links.url any ", tripadvisor, travbuddy" } "Guide" { links.url any "lonelyplanet, roughguides, frommers, fodors, traveldk, cntraveller" } "Booking" { links.url any "responsibletravel, skyscanner, expedia,,, airbnb, kayak, makemytrip, cheapoair, trivago, orbitz, travelocity" }

Again these rules could be expanded to include further sites and markets.

Once you've finished defining your filter and tags you can start your recording. Any interactions which are stories sharing travel links or engagements on these stories will be stored into your index labelled with the site categories you specified in your classification rules.

Again, when you come to defining tags for your real-world use case you will need to spend time iterating and testing these rules.

Validating your interaction filter

PYLON's privacy model prevents you from seeing the text of non-public posts. To validate that your interaction filter is recording the correct interactions you can perform some exploratory analysis queries and inspect super public text samples.

For example, in this case you could start by performing a frequency distribution analysis using the links.url target to see the top URLs shared by your audience, and to check that your filter is capturing the correct links.


Super public text samples allow you see verbatim text posted by your audience. Here are sample posts recorded by the example filter above:


This table shows the content of each post, the title of the link being shared and the topics inferred from the story by Facebook. You can see that the content being captured is very relevant to the topic. You can also use super public text samples to check your classification rules are working as intended.

tip icon

Learn how to make use of super public samples to improve your filter by reading our guide.

Example Analysis Results

When you have started to record classified interactions to an index you can analyze your recorded audience. Let's look at some typical analysis you may want to include.

Note that for all the example analysis results below the following query filter was applied so that analysis was restricted to only the US audience: == "United States"

Audience overview

Before you look in detail at what topics your audience is engaging with it is always worth looking at your audience as a whole, as for instance there may have been a peak in activity that skews your results.

Firstly you can perform a time series analysis of your audience to see the pattern of engagement.


The result has been baselined against the general US Facebook audience. As you'd expect the audience is active at similar times to the general audience and there have been no huge spikes in activity.

Using the and demographic targets in a nested query you can analyze the composition of the engaged audience:


Again, to see how the audience compares to the general US Facebook audience this chart has been baselined. The grey bars show the baseline audience. You can see from this chart that females aged 45 and above are particularly active with travel topics.

tip icon

Learn more about comparing audiences by reading our baselining analysis results pattern.

Popular sites and content

Now that you have an overview of your audience you'll want to look at the top sites and pieces of content that are driving engagement.

Using the links.domain target you can perform a frequency distribution analysis to see the top domains being shared and engaged with:


You can use the links.url target to analyze the top links driving engagement:


During the analyzed period is particularly popular. You can see in the chart above that this is due to a combination of popular stories as opposed to one story which has gone viral.

You can use classification in your analysis, for instance the types of site suggested above. Using the interaction.tag_tree target you can analyze which types of travel site drive most engagement:


Clearly it is travel magazine sites that are driving engagement.

Popular sites, content, and topics for demographic groups

Now that you have an understanding of what content is driving engagement for your entire audience you'll want to drill down into audience segments.

For instance, a nested frequency distribution analysis using the interaction.tag_tree targets (to analyze site types), the target and targets show how types of site drive engagement for each demographic segment.


This result has been baselined against the recorded travel audience as opposed to the general Facebook audience to see which type of site appeals to which segment.

You can look specifically at which domains drive engagement for each segment. This result was produced by using a query filter to select females only, and then performing a nested query using the links.domain and targets.


You can see performs well for all segments, but there is significant variation for domains across groups.

You can also look at which links drive engagement for each segment. The next chart shows the result of the same analysis as above, but using the links.title target.


You can go further by looking at the sentiment expressed when links are shared. This chart shows the result of analysis using the fb.parent.sentiment target, along with and links.title. This analysis shows whether it is positive or negative stories sharing the link which are receiving the most engagement.


It is also important to understand the topics that are driving engagement for each segment of the audience. As the example focuses on travel, you would expect that destination countries and cities would be prominent.

You can use the fb.parent.topics.category_name target to see what topics appear in stories that are driving the most engagement. This chart shows the result of analyzing engagement from females only, analyzing the topics using fb.parent.topics.category_name against age groups.


Focusing on topics in the City category, you can see that Chicago, Miami, and New York are receiving most engagement from 25-34 year old females.

Identifying topics for content optimization

Above you saw how you can analyze segments of your audience to identify content and topics which are receiving the most engagement. Based upon these insights you can create a content optimization strategy.

For example, if you are looking to target females between 25 and 34 you know from above that three cities are receiving the most attention. You could therefore tailor your ad content to focus on one or more of these cities.

To make your content even more effective, you could look to tailor your content to what it is about these cities that is engaging your audience.

To understand what is driving engagement for a city for a particular audience segment you can repeat the analysis above but use a query filter to focus on just stories and engagements relating to the city from the target segment. For example, to focus on New York engagement from females between 25 and 34:

fb.parent.topics.category_name == "City|New York, New York" 
AND == "25-34" AND == "female"

A frequency distribution analysis using the links.title target and the above query filter, reveals the content receiving most engagement.


A frequency distribution analysis using the fb.parent.topics.category_name target and the above query filter reveals the topics which are most engaging to the audience.


It's interesting to see that topics such as the Frieze Art Fair, Tribeca Film Festival, and kayaking are driving engagement for the target audience. Tailoring your content to focus, for instance, on the film festival could give your adverts big impact.