Get started

You can work with Ad Targeting within Meta Researcher Platform. The getting started procedure documented here is specific to the Researcher Platform that runs a modified version of Jupyter and provides you with a virtual data cleanroom where you can securely search for and analyze data. To get up and running with Ad Targeting in Researcher Platform:

Set up OpenVPN

After January 7, 2025, access to Ad Targeting in Researcher Platform will require Amazon WorkSpaces Secure Browser. See WorkSpaces Secure Browser in the Researcher Platform documentation for instructions. You will not lose any data in this transition. With WorkSpaces Secure Browser, you do not need a VPN to access Researcher Platform. The Get started in Researcher Platform section on this page provides the URL so you can try it.

Until January 7, 2025, you can access Ad Targeting through a Virtual Private Network (VPN). This section shows you how to install and configure the OpenVPN client and connect to our VPN server. Once connected, you will be able to access Ad Targeting.

Step 1: Download and install OpenVPN

When the setup wizard completes, OpenVPN Connect launches and you are required to accept the OpenVPN Inc. Data Collection, Use and Retention policy to continue.

Step 2: Set up your profile

In the Import Profile window, select the UPLOAD FILE tab.



Step 3: Download the OpenVPN configuration file

Clicking this link downloads the OpenVPN configuration file (fortVpnCredentials.ovpn) to your computer (check your downloads folder). Once downloaded, drag and drop the file into the Import Profile window.

Step 4: Connect to the VPN

In the Imported Profile window, click CONNECT.



Once successfully connected, you will see this window:

Continue with the next steps below to access the Researcher Platform. Note that while you are connected to our VPN server, all of your internet traffic is routed through it, so be sure to disconnect from the VPN server when you are finished.

Get started in Researcher Platform

Step 1: Log in

While connected to our VPN, visit the Researcher Platform.

You can also use the latest Amazon WorkSpaces Secure Browser version of Researcher Platform without being connected to the VPN.

Log into the site by using your Facebook credentials. This will spin up a Jupyter Notebook server instance for your use.

You can access Researcher Platform user documentation here.

Step 2: Create a notebook

Click the New dropdown menu and select either Python3 or R. This will create a new Jupyter Notebook in a new browser tab. Rename the Notebook if you wish.

The 'New' dropdown menu in Jupyter Hub showing 'Python 3' as an option.

Step 3: Import the query module

Import our query module (execute) by clicking in an empty notebook cell and entering the following code:

library(fbrir)
from fbri.private.sql.query import execute

Run the code by clicking <. Initially you will not see anything happen. A new notebook cell appears when it finishes importing the query.

Step 4: Create and run a SQL query

Enter the following code in the empty notebook cell to define a SQL query (sql) using variable substitution (database and table), and use the query module to execute the query:

library(fbrir)
athena = AthenaFacade$new()

database <- "fbri_prod_atp"
table <- "ad_targeting_dataset_siep_aug_2020"
api_table <- "ad_archive_api"

# Define your own SQL query and assign to variable 'sql' 
sql <- sprintf("SELECT * FROM %s.%s LIMIT 5", database, table)
athena$QueryAthena(sql)
from fbri.private.sql.query import execute

database = "fbri_prod_atp"
table = "ad_targeting_dataset_siep_aug_2020"
api_table = "ad_archive_api"

# Define your own SQL query and assign to variable 'sql' 
sql = f"SELECT * FROM {database}.{table} LIMIT 5"

execute(sql)

Run the code. This should return a dataframe of your results, similar to those shown below (screenshots of dataframe results blurred intentionally).

The dataframe result from the R example would look similar to this (blurred intentionally):



The dataframe result from the Python example would look similar to this (blurred intentionally):



You can scroll within the dataframe to see additional table columns.

Next steps

Performing the query above verifies that you are able to perform a basic search by using our web application. We recommend that you now read a few sample queries to get an idea of how to build your own custom queries.