Skip to content

Commit

Permalink
Migrate to API v15
Browse files Browse the repository at this point in the history
  • Loading branch information
selesnow committed Mar 11, 2024
1 parent 00ec408 commit 7d4b17c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
^Meta$
^CRAN-SUBMISSION$
^cran-comments\.md$
^rgoogleads-manual\.tex$
^lastMiKTeXException$
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# options
op <- options()
op.gads <- list(gads.developer.token = developer_token,
gads.api.version = "v13",
gads.api.version = "v15",
gads.login.customer.id = login_customer_id,
gads.customer.id = customer_id,
gads.multi.account.verbos = FALSE,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ gads_auth('me@gmail.com')

For obtain own developer token and OAuth client read the following documentation:

* [Obtain Your Developer Token](https://developers.google.com/google-ads/api/docs/first-call/dev-token)
* [Configure a Google API Console Project for the Google Ads API](https://developers.google.com/google-ads/api/docs/first-call/oauth-cloud-project)
* [Obtain Your Developer Token](https://developers.google.com/google-ads/api/docs/get-started/dev-token)
* [Configure a Google API Console Project for the Google Ads API](https://developers.google.com/google-ads/api/docs/get-started/oauth-cloud-project)

## Example of use rgoogleads

Expand Down Expand Up @@ -185,7 +185,7 @@ This section contains links to articles dedicated to `rgoogleads`.
If you have published an article about `rgoogleads` let me know about it in [telegram](https://t.me/AlexeySeleznev) or [email](mailto:selesnow@gmail.com) and I will add it to the list of links.

## Author
Alexey Seleznev, Head of analytics dept. at [Netpeak](https://netpeak.net/en/us/)
Alexey Seleznev, Head of analytics dept. at [Netpeak](https://netpeak.us/)
<Br>Telegram Channel: [R4marketing](https://t.me/R4marketing)
<Br>email: selesnow@gmail.com
<Br>facebook: [facebook.com/selesnow](https://www.facebook.com/selesnow)
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

0 errors | 0 warnings | 0 note

* Critical update for `gads_get_geo_targets()` function.
* Change Google Ads API versions.
10 changes: 5 additions & 5 deletions test.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gads_auth_configure(

gads_auth(email = 'alsey.netpeak@gmail.com', cache = F)

gads_auth(email = 'alsey.netpeak@gmail.com' )
gads_auth(email = 'a.seleznev@netpeak.group' )



Expand Down Expand Up @@ -85,7 +85,7 @@ gads_set_customer_id('6766427440')

# load account hierarchy --------------------------------------------------
# загрузка списка аккаунтов
accounts_main <- gads_get_account_hierarchy('175-410-7253')
accounts_main <- gads_get_account_hierarchy()
client_acs <- accounts_main$customer_client_id[accounts_main$customer_client_manager == FALSE]
# load reports ------------------------------------------------------------
# загрузка статистики
Expand All @@ -96,13 +96,13 @@ camp_stat <- gads_get_report()
camp_stat_2 <- gads_get_report(
date_from = as.Date('2021-06-10'),
date_to = as.Date('2021-06-17'),
customer_id = '473-251-9773'
customer_id = '7907111282'
)

# меняем ресурс и поля
gads_set_customer_id('4732519773')
adstat <- gads_get_report(
customer_id = 4732519773,
customer_id = 7907111282,
resource = 'ad_group_ad',
fields = c("ad_group_ad.ad.id", "ad_group_ad.ad.name", "ad_group_ad.status", "metrics.clicks"),
date_from = '2021-06-10',
Expand All @@ -127,7 +127,7 @@ group_report <- gads_get_report(
)

# загрузка данных сразу из 4ёх аккаунтов
acs <- c( 1507592784, 8183215956, 6983359454, 9382181697, 5720644438, 7708567525, 7701918735, 9936483356 )
acs <- c( 1507592784, 8183215956, 6983359454, 7907111282, 5720644438, 7708567525, 7701918735, 9936483356 )

multi_rep <- gads_get_report(
customer_id = acs,
Expand Down

0 comments on commit 7d4b17c

Please sign in to comment.