Analyzing Shared Links

A great way to measure engagement with a campaign or website is to examine interactions which share links.

For the Facebook topic data source you have access to targets such as and fb.link_title, but also the links augmentation. We recommend you use the links augmentation targets (links.*) as any link provided in and fb.link_title is automatically included in the links augmentation.

tip icon

Remember when you write any query you need to consider whether you are looking for stories, engagements or both.

The links augmentation targets (links.*) cover both stories and engagements. That is to say if you filter using links.url if the interaction is a story this equates to, whereas if the interaction is an engagement it equates to

You can read our introduction to Facebook topic data for more details.

Analysis Query Filters

You can filter against shared links to subset your recorded data before performing analysis.

When you submit an analysis query you can provide an optional filter using the filter parameter. This parameter accepts CSDL allowing you to subset the data in your index before the analysis is run.

Content with a Link

Firstly you might want to simply filter to only content that shares a link. You can do so using the exists operator combined with the links.url target.

links.url exists

Note this CSDL would pick up both stories with links, and engagements on stories with links. If you'd like to just filter for stories or a type of engagement you could also use the fb.type target.

For example this CSDL will filter for interactions that are stories with links only:

links.url exists AND fb.type == "story"

Exact URLs

Another scenario is you want to analyze only interactions that link to a certain URL, for instance that relates to a marketing campaign.

To filter to content that shares a specific URL:

links.url == ""

To filter to content that shares any of a list of URLs:

links.url in ","

Again you could combine this with the fb.type target if you want to restrict your filter to stories or types of engagement.

Domains and Paths

Or of course you might want to filter to links that point to a domain or a path on a domain.

To filter to domain make use of the links.domain target:

links.domain == ""

To filter to a path on a domain:

links.url contains ""

For example a full query to analyze links that are from a certain domain:

    "analysis_type": "freqDist",
    "filter": "links.domain == \"\"",
    "parameters": {
        "target": "links.url",
        "threshold": 5

tip icon

Note that the the links.url target is tokenized for query filter usage, as is the links.normalized_url target. This is very useful as you can use string operators such as contains and contains_any to match strings within domains and paths.

Page Titles

It is also possible to filter on the titles of pages that have been shared. When a user shares a link, if the link is resolvable then the title for the page will be fetched.

_Note that page titles are only fetched for the first link in a post, that is to say that the title will be fetched if possible for the link given by the target (which is the first link provided by the links augmentation). The title for the link is accessible using the fb.link_title target, but we recommend you use the links.title target for your filters._

So for example you could filter to links that have automotive brands in their titles:

links.title contains_any "Audi, Honda, Renault"

Or links from a particular domain with keywords in their title:

links.domain IN "" AND links.title contains_any "US Open, PGA Tour"

Analysis Targets

You can of course use links.* targets for your analysis too.

It's most likely you'll want to analyze the domains shared (use links.domain for this) or full URLs for links (use links.url) for this.

For example:

    "analysis_type": "freqDist",
    "parameters": {
        "target": "links.domain",
        "threshold": 3

The links.title target is available in analysis queries but titles are truncated to 256 characters.

For example:

    "analysis_type": "freqDist",
    "parameters": {
        "target": "links.title",
        "threshold": 10