Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/docs/01_get-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ sidebar_position: 0

To help you get started and better navigate the research landscape of social media monitoring (SMM) and researching online discourse more broadly, we’ve collected a first set of chapters that aim to provide orientation and guidance to researchers and practitioners exploring various options and dimensions of independently researching social media. We welcome additional content and have added a selection of chapters below that would make for great contributions.

<details>
<summary>Overview: Tools for working with digital trace data</summary>

The purpose of this entry is to provide an overview of tools that can be used across the research data cycle when working with digital trace data: From data collection to preprocessing, analysis and visualization, reporting, and archiving and sharing data.

**[Learn more](01_01_overview)**
</details>
<details>
<summary>Ethical considerations</summary>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ includes metadata such as the ad’s text, the advertiser’s page, the time
period it ran, the amount spent (as a range), impressions delivered
(also as a range), and breakdowns of the audience by age, gender, and
region. Importantly, many metrics are given as ranges (min–max) rather
than precise values. This tutorial will demonstrate how to use R (with
than precise values.

This tutorial will demonstrate how to use R (with
the `tidyverse` ecosystem) and the `Radlibrary` R package to access the
Meta Ad Library via its official API. We will walk through obtaining API
access, constructing queries to find ads (by keyword or page id),
Expand Down Expand Up @@ -69,17 +71,10 @@ API. Meta requires a few one-time setup steps:
confidential and treat it like a password – anyone with this token
could potentially query the API on your behalf until it expires.

> Token expiration: By default, tokens from the Explorer are
> [short-lived](https://developers.facebook.com/docs/facebook-login/guides/access-tokens#termtokens)
> (usually ~1-2 hours). For short analysis sessions that might be
> sufficient, but in most cases you will likely need longer access. You
> can exchange the short-lived token for a 60-day token using your App’s
> App ID and App Secret. In this tutorial, we will proceed with a
> short-lived token for simplicity, but it is strongly encouraged to get
> a long-term token for your analysis (holds for 60 days). For
> instructions on how to do this, refer to the [official Meta
> documentation on access
> tokens](https://facebookresearch.github.io/Radlibrary/articles/Radlibrary.html#generating-persistent-tokens).
:::hub-note Note
**Token expiration:** By default, tokens from the Explorer are [short-lived](https://developers.facebook.com/docs/facebook-login/guides/access-tokens#termtokens)(usually ~1-2 hours). For short analysis sessions that might be
sufficient, but in most cases you will likely need longer access. You can exchange the short-lived token for a 60-day token using your App’s App ID and App Secret. In this tutorial, we will proceed with a short-lived token for simplicity, but it is strongly encouraged to get a long-term token for your analysis (holds for 60 days). For instructions on how to do this, refer to the [official Meta documentation on access tokens](https://facebookresearch.github.io/Radlibrary/articles/Radlibrary.html#generating-persistent-tokens).
:::

### Step 2: Installing and Loading R Packages

Expand Down Expand Up @@ -212,12 +207,9 @@ query <- adlib_build_query(
)
```

> **Note**: You might encounter the following warning:
> *Warning: Unsupported fields supplied:* followed by a list of
> parameters.
> This warning can be safely ignored. The `Radlibrary` package, despite
> being developed by the Facebook team, may not be up to date with the
> newest parameters.
:::hub-note Note
You might encounter the following warning: *Warning: Unsupported fields supplied:* followed by a list of parameters. This warning can be safely ignored. The `Radlibrary` package, despite being developed by the Facebook team, may not be up to date with the newest parameters.
:::

------------------------------------------------------------------------

Expand Down Expand Up @@ -706,8 +698,9 @@ gender, and percentage. Each row might say, for example, ad X – age
women aged 18-24). The percentages for a given ad across all age/gender
categories sum up to 100%.

> Important: if an ad did not reach a particular demographic group, it may
not have an entry for that group.
:::community[Important]
If an ad did not reach a particular demographic group, it may not have an entry for that group.
:::

Now, what can we learn from this? Here are a couple of insights we might
extract:
Expand All @@ -720,10 +713,9 @@ or simply fail to engage older audiences. Similarly, we could examine
how many ads target women vs. men, or the average percentage of
impressions to women vs. men.

> *Note of caution:* A more robust analysis would weight the data by
impressions or spending. Averaging percentages across ads without doing
so treats a low-reach ad the same as a high-reach one. For simplicity,
however, we proceed with the unweighted approach.
:::community[Note of caution]
A more robust analysis would weight the data by impressions or spending. Averaging percentages across ads without doing so treats a low-reach ad the same as a high-reach one. For simplicity, however, we proceed with the unweighted approach.
:::

For a quick view, we can calculate the overall gender split in relative
impressions, assuming equal weight per ad (again, caution advised):
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/03_data-collection/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sidebar_position: 0
</style>

# Data collection methods
<LastUpdatedByChip authorLastUpdate="Cathleen Berger" updatedOn="06.12.2024" />
<LastUpdatedByChip authorLastUpdate="Clara Ruthardt" updatedOn="01.08.2025" />

Data collection on social media and digital platforms comes with a range of specificities and nuances that, unfortunately, differ across each platform. To facilitate research and give you an idea of what’s possible on which platform, this section outlines data collection approaches and introduces examples for TikTok, X (Twitter), and blogs (including code). Additional examples or contributions to data collections methods are welcome, suggestions are listed under (4) call for contributions.

Expand All @@ -39,9 +39,9 @@ Data collection on social media and digital platforms comes with a range of spec
<details>
<summary>Platform-specific guidelines, e.g. X API, Streaming data</summary>

X (Twitter) with its vast user base and real-time data, has always been a fertile ground for researchers and developers alike. This chapter provides a comprehensive guide to making the most out of the API, with specific attention to a newly developed Python library, underscoring its flexibility and scalability.
This chapter outlines platform-specific guidelines for data collection across X (Twitter), YouTube, Rumble, and Meta Ads on Facebook and Instagram. Each guideline includes step-by-step tutorials with code samples and an introduction to potential analysis methods.

**[Learn more](03_00_code-samples/twitter/streaming-database)**
**[Learn more](03_00_platform-specific guidelines)**
</details>

<details>
Expand All @@ -55,6 +55,6 @@ Data collection on social media and digital platforms comes with a range of spec

:::contribute Open for contributions

Contributions are welcome, particularly case studies on Facebook, Instagram, YouTube and other platforms as well as additional data collection tactics and methods.
Contributions are welcome, particularly on additional data collection tactics and methods.

:::
24 changes: 11 additions & 13 deletions docs/docs/04_data-analysis/04_05_metatargetr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ perspective.

Here are the key advantages over Meta’s official Ad Library API:

- Advertiser-Level Data: Instead of looking at single ads, we get a
- **Advertiser-Level Data:** Instead of looking at single ads, we get a
consolidated view of the entire targeting strategy of a Facebook page
or Instagram account.

- Exact Spending per Criterion: The data provides the exact percentage
- **Exact Spending per Criterion:** The data provides the exact percentage
of a page’s total spend allocated to each specific targeting
criterion. This allows for precise analysis of budget allocation, a
feature not available through the official API.

- Additional Audience Insights: The dataset goes beyond the demographic
- **Additional Audience Insights:** The dataset goes beyond the demographic
targeting that is available via the API, as it reveals spending on
powerful tools like Detailed Targeting (e.g. interest profiles that
Meta categorizes its users in), Custom Audiences (e.g., targeting a
Expand Down Expand Up @@ -327,12 +327,9 @@ spending for each targeting criterion based on the new, combined total.
# Apply the function to our DHS data
dhs_data_agg <- aggr_targeting(dhs_data_raw)
```

> Note: the `aggr_targeting()` function creates a variable called
> `spend_per` which shows the spend per targeting criterion
> across the combined period. If you pull raw data with `get_targeting_db()`, you have to compute this measure
> yourself as *total spending* (`total_spend_formatted`) *×* *share of spending*
> (`total_spend_pct`).
:::hub-note Note
The `aggr_targeting()` function creates a variable called `spend_per` which shows the spend per targeting criterion across the combined period. If you pull raw data with `get_targeting_db()`, you have to compute this measure yourself as *total spending* (`total_spend_formatted`) *×* *share of spending* (`total_spend_pct`).
:::


### Visualizing "Detailed" Targeting Criteria
Expand Down Expand Up @@ -390,8 +387,9 @@ in Mexican culture events and music, and whose language is set to
Spanish. This provides concrete, data-driven insights into their
campaign strategy that would be difficult to obtain otherwise.

> Note: When multiple targeting criteria show identical spend, that likely indicates they were applied together on the same underlying ads. Because the data that is retrieved is aggregated at the advertiser level it is hard to isolate ads that ran simultaneously. For a better measurement of spend we could divide the total spending by the number of targeting criteria that have the same data (same number of ads and spending) by assuming that spending was divided about equally to each targeting criterion.

:::hub-note Note
When multiple targeting criteria show identical spend, that likely indicates they were applied together on the same underlying ads. Because the data that is retrieved is aggregated at the advertiser level it is hard to isolate ads that ran simultaneously. For a better measurement of spend we could divide the total spending by the number of targeting criteria that have the same data (same number of ads and spending) by assuming that spending was divided about equally to each targeting criterion.
:::

### Visualizing Location Targeting Criteria

Expand Down Expand Up @@ -510,11 +508,11 @@ the targeting criteria used as proxies for the Latino community are also
employed by a diverse range of other major advertisers. The top 10
spenders using these methods include:

- Public Health & Advocacy Groups: Organizations like Planned
- **Public Health & Advocacy Groups:** Organizations like Planned
Parenthood, Tobacco Free Florida, and The California Endowment use
this targeting for outreach and awareness campaigns.

- Non-Profits and Charities: Pages such as Catholic Relief Services,
- **Non-Profits and Charities:** Pages such as Catholic Relief Services,
Operation Smile, and The International Fellowship of Christians and
Jews appear to use these criteria for fundraising and supporter
engagement.
Expand Down
10 changes: 9 additions & 1 deletion docs/docs/04_data-analysis/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sidebar_position: 0
</style>

# Data analysis projects
<LastUpdatedByChip authorLastUpdate="Cathleen Berger" updatedOn="06.12.2024" />
<LastUpdatedByChip authorLastUpdate="Clara Ruthardt" updatedOn="01.08.2025" />

To help you get started and inspired with social media analyses, we’ve collected a first set of practical projects that provide a starting point. There are a myrdiad of projects and methods discussion around social media data. Therefore, we welcome additional content and have added a selection of chapters below that would make for great contributions.

Expand Down Expand Up @@ -53,6 +53,14 @@ To help you get started and inspired with social media analyses, we’ve collect
**[Learn more](04_04_disarm-framework)**
</details>

<details>
<summary>Analyzing Ad Targeting Insights: An Introduction to the metatargetr R Package</summary>

The metatargetr R package offers an alternative, unofficial route to this information, by retrieving and archiving ad data directly from Meta’s public-facing Ad Library. This tutorial focuses on how to use metatargetr to retrieve and, most importantly, analyze this targeting data.

**[Learn more](04_05_metatargetr)**
</details>

:::contribute Open for contributions

We welcome contributions on a rolling basis. Have you done an analysis or a research project you want to share? Do you want to contribute a primer for a specific method? Get in touch with us at [upgrade.democracy@bertelsmann-stiftung.de](mailto:upgrade.democracy@bertelsmann-stiftung.de)
Expand Down
9 changes: 8 additions & 1 deletion docs/docs/05_literature/05_03_articles-and-research.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ title: Community articles and research

# Community articles and research

<LastUpdatedByChip authorOriginal="Clara Ruthardt" createdOn="30.09.2024" authorLastUpdate="Cathleen Berger" updatedOn="06.12.2024" />
<LastUpdatedByChip authorOriginal="Clara Ruthardt" createdOn="30.09.2024" authorLastUpdate="Clara Ruthardt" updatedOn="01.08.2025" />

Social media research is a rapidly changing field. In this chapter you can find the latest research reports, tools, policy papers and articles from our community.

_Please note: Despite careful review of the content, the Data Knowledge Hub accepts no liability for the content of external links. The providers of the web pages to which the links lead are solely responsible for their contents._

<ArticleCard
heading="Social Media Monitoring Toolkit"
author="Democracy Reporting International"
teaser="The Digital Democracy Monitor Toolkit helps civil society, journalists, researchers and anyone trying to research social media and democracy."
link="https://digitalmonitor.democracy-reporting.org/toolkit/"
/>

<ArticleCard
heading="Custom Portal for Innovative Data Collection and Disinformation Analysis"
author="Inform Africa"
Expand Down
28 changes: 28 additions & 0 deletions docs/docs/06_contribute/06_02_community.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ The Data Knowledge Hub for researching online discourse is a community effort. W
mastodon="https://masto.ai/@correlaid"
/>

<AuthorCard
name="Fabio Votta"
avatar="FV"
avatarSrc={require("@site/static/img/contributors/votta.jpg").default}
position="ASCoR | University of Amsterdam"
website="https://www.favstats.eu/"
bluesky="https://bsky.app/profile/favstats.eu"
linkedin="https://www.linkedin.com/in/dr-fabio-votta-81a862131"
/>

<AuthorCard
name="Heather Dannyelle Thompson"
avatar="HT"
Expand Down Expand Up @@ -126,6 +136,15 @@ The Data Knowledge Hub for researching online discourse is a community effort. W
website="https://www.unibw.de/jasmin.riedl"
/>

<AuthorCard
name="Johannes Breuer"
avatar="JB"
avatarSrc={require("@site/static/img/contributors/breuer.png").default}
position="Senior Researcher, GESIS - Leibniz Institute for the Social Sciences"
website="https://www.johannesbreuer.com/"
mastodon="https://fediscience.org/@JohannesBreuer"
/>

<AuthorCard
name="Josef Holnburger"
avatar="JH"
Expand Down Expand Up @@ -161,6 +180,15 @@ The Data Knowledge Hub for researching online discourse is a community effort. W
linkedin="https://de.linkedin.com/in/philipp-darius"
/>

<AuthorCard
name="Richard Schwenn"
avatar="RS"
avatarSrc={require("@site/static/img/contributors/schwenn.jpg").default}
position="polisphere"
website="https://www.polisphere.eu/de/"
linkedin="https://www.linkedin.com/in/richard-schwenn-6b787623a/"
/>

<AuthorCard
name="Valerie Hase"
avatar="VH"
Expand Down