Skip to content

Commit

Permalink
Migrate to api v 18
Browse files Browse the repository at this point in the history
  • Loading branch information
selesnow committed Jan 16, 2024
1 parent e9ce822 commit dc548c4
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ _config.yml
^getToken$
index.md
^doc$
^Meta$
.RData
.Rhisroty
^cran-comments\.md$
^CRAN-SUBMISSION$
^vignettes
^Meta$
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.9.3
Date: 2023-05-16 11:05:03 UTC
SHA: bd10f648df60ae82b271fd086acc35087e513339
Version: 2.9.9
Date: 2024-01-15 17:07:14 UTC
SHA: e9ce8225a8da71f5d960b843c6800b48e0af01c3
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rfacebookstat
Type: Package
Title: Load Data from Facebook API Marketing
Version: 2.9.4
Version: 2.9.9
Authors@R:
c(person(given = "Alexey",
family = "Seleznev",
Expand All @@ -27,5 +27,5 @@ URL: https://selesnow.github.io/rfacebookstat/, https://www.youtube.com/playlist
License: MIT + file LICENSE
Suggests: knitr, rmarkdown
Encoding: UTF-8
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Binary file modified Meta/vignette.rds
Binary file not shown.
23 changes: 22 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# rfacebookstat 2.9.9

* Cran fixing

# rfacebookstat 2.9.8

* Cran fixing

# rfacebookstat 2.9.7

* Исправление ссылок для документации.

# rfacebookstat 2.9.6

* Исправление ссылок для документации.

# rfacebookstat 2.9.5

* Пакет переведён на работу с Facebook Marketing API v.18.
* Исправлены некоторые устаревшие ссылки в документации.

# rfacebookstat 2.9.4

* В функции `fbGetAccounts()` снизил лимит на количество запрашиваемых аккаунтов в одном запросе с 300 до 150, связано с ошибкой `Please reduce the amount of data you're asking for, then retry your request`.
Expand Down Expand Up @@ -58,7 +79,7 @@

* Пакет переведён на работу с API v12.0
* Исправлена работа аргумента interval в функции `fbGetMarketingStat()`.
* В функции `fbAuth()` и `fbGetToken()` отдельным аргументом выделен scopes, который позволяет по необходимости исключать неиспользуемые разрешения, например business_management. Более подробно о разрешениях можно почитать в [справоке](https://developers.facebook.com/docs/permissions/reference/).
* В функции `fbAuth()` и `fbGetToken()` отдельным аргументом выделен scopes, который позволяет по необходимости исключать неиспользуемые разрешения, например business_management. Более подробно о разрешениях можно почитать в [справоке](https://developers.facebook.com/docs/permissions).

# rfacebookstat 2.4.0

Expand Down
2 changes: 1 addition & 1 deletion R/authorization.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Get API facebook token for access to facebook ads API.
#'
#' @param app_id ID of your Facebook App
#' @param scopes Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions/reference/}{docmentation}
#' @param scopes Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions}{docmentation}
#'
#' @return API token
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ rfacebookstatWelcomeMessage <- function(){
}

op <- options()
op.rfacebookstat <- list(rfacebookstat.api_version = "v16.0",
op.rfacebookstat <- list(rfacebookstat.api_version = "v18.0",
rfacebookstat.access_token = fb_token,
rfacebookstat.accounts_id = NULL,
rfacebookstat.business_id = NULL,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ devtools::install_github('selesnow/rfacebookstat')
3. [Список релизов](https://github.com/selesnow/rfacebookstat/releases).

### Автор пакета
Алексей Селезнёв, Head of analytics dept. at [Netpeak](https://netpeak.net/en/us/)
Алексей Селезнёв, Head of analytics dept. at [Netpeak](https://netpeak.us/)
<Br>email: [email protected]
<Br>skype: selesnow
<Br>facebook: [facebook.com/selesnow](https://www.facebook.com/selesnow)
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 0 note
0 errors | 0 warnings | 1 note

* check and rebuild vignetts.
* Fix "Package has a VignetteBuilder field but no prebuilt vignette index.".
2 changes: 1 addition & 1 deletion man/fbAuth.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fbAuth(username = getOption("rfacebookstat.username"),
\item{app_id}{ID of Facebook App}
\item{app_secret}{Secret of Facebook App}
\item{token_path}{path to dir with credentials}
\item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions/reference/}{docmentation}}
\item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions}{docmentation}}
\item{reauth}{boolean, do reauthorization}
\item{skip_option}{logical, skip access token from options or not}
}
Expand Down
4 changes: 2 additions & 2 deletions man/fbGetMarketingStat.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fbGetMarketingStat(
\item{level}{Represents the level of result. Avable ad, adset, campaign, account.}
\item{action_breakdowns}{group results in the actions field. You can use the following breakdowns for action_breakdowns, for details \href{https://developers.facebook.com/docs/marketing-api/insights/breakdowns/#actionsbreakdown}{go}, or see details}
\item{breakdowns}{Permutations marked with an asterisk (*) can be joined with action_type and action_target_id. Avable age, country, gender, frequency_value, hourly_stats_aggregated_by_advertiser_time_zone, hourly_stats_aggregated_by_audience_time_zone, impression_device, place_page_id, placement, device_platform, product_id, region. See details.}
\item{fields}{List of fields which you want get in R. You can find list of available fields at Facebook API documentation by this \href{https://developers.facebook.com/docs/marketing-api/insights/parameters#fields}{link}.}
\item{fields}{List of fields which you want get in R.}
\item{filtering}{Vector of filtring or JSON string with array of filtring parameters, on example \code{"ad.effective_status IN ARCHIVED"} \code{[{/'field/':/'ad.effective_status/',/'operator/':/'IN/',/'value/':[/'ARCHIVED/']}}, see filtring block for more examples}
\item{date_start}{Start reporting date.}
\item{date_stop}{End reporting day}
Expand Down Expand Up @@ -172,7 +172,7 @@ Filtring with operators IN_RANGE, NOT_IN_RANGE, IN, NOT_IN
\author{Alexey Seleznev}

\seealso{
All avable field, and discription of all parameters you can see oh this \href{https://developers.facebook.com/docs/marketing-api/insights/parameters}{link}.
All avable field, and discription of all parameters you can see oh this \href{https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights}{link}.
More information about breakdowns and action brekdowns on this \href{https://developers.facebook.com/docs/marketing-api/insights/breakdowns}{link}.
More information about action field in this \href{https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/}{documentation}.
}
Expand Down
2 changes: 1 addition & 1 deletion man/fbGetToken.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion tests/main_tests.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
library(rfacebookstat)
library(dplyr)
fbAuth(username = 'selesnow', skip_option = T)
fbSetUsername('selesnow')
fbGetSettings()

# accounts
bm <- fbGetBusinessManagers()
Expand All @@ -13,7 +16,7 @@ ads <- fbGetAds(test_accs)
creo <- fbGetAdCreative(test_accs)
apps <- fbGetApps()
pages <- fbGetPages(test_accs)
videos <- fbGetAdVideos(my_acs$id[4:10])
videos <- fbGetAdVideos(test_accs)
conversions <- fbGetAdAccountsConversions(test_accs)
# users
bm_users <- fbGetBusinessManagersUsers(bm$id[1])
Expand Down
2 changes: 1 addition & 1 deletion vignettes/rfacebookstat-get-statistics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ knitr::opts_chunk$set(
* *level* - Уровень группировки данных, принимает одно из следующих значений: ad, adset, campaign, account. По умолчанию имеет значение account.
* *action_breakdowns* - Разбивки по действиям, более подробно о них можно узнать в [документации](https://developers.facebook.com/docs/marketing-api/insights/breakdowns#actionsbreakdown) к API Facebook, так же более подробно они будут рассмотрены позже в этой виньетке.
* *breakdowns* - Общие разбивки которые предоставляют дополнительные возможности по группировке данных, подробности в [документации](https://developers.facebook.com/docs/marketing-api/insights/breakdowns#ageandgender) к API Facebook, так же этот аргумент будет более подробно рассмотрен немного ниже.
* *fields* - Поля которые вы хотите загрузить из API, полный список всех полей доступен по [ссылке](https://developers.facebook.com/docs/marketing-api/insights/parameters#fields).
* *fields* - Поля которые вы хотите загрузить из API, полный список всех полей доступен по [ссылке](https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights).
* *filtering* - Текстовая строка или вектор. Фильтрацию отчёта вы можете задавать либо в JSON формате либо в упрощенном формате, более подробно о фильтрации будет написано немного ниже.
* *date_start* - Дата начала отчётного периода.
* *date_stop* - Дата завершения рабочего отчётного периода.
Expand Down

0 comments on commit dc548c4

Please sign in to comment.