facebookresearch / Radlibrary

An R package for accessing the Facebook Ad Library API

Home Page:https://facebookresearch.github.io/Radlibrary/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should param specifications in adlib_get_query match as_tibble?

kylescotshank opened this issue · comments

Currently:

query <- adlib_build_query(...,
                           fields = "ad_data")

but

as_tibble(some_query_result, type = "ad") 

Should we have the value passed to the type param in as_tibble() match fields within adlib_build_query?

IMO no, because fields can take on values that type can't. "ad_data" is a convenient nickname for c("page_id", "page_name", "spend", "impressions",...), i.e. all the fields that you need in order to construct the ad_table. Whereas, the type argument specifies which type of table to build from the response object—and the response object could support multiple types depending on what is contained in it. Does that make sense?

Yep! Aligned.