From 8842f93b9d0b1243ad6034e68902e50cfee7a1c4 Mon Sep 17 00:00:00 2001 From: Mark Edmondson Date: Sun, 13 Jan 2019 10:19:44 +0100 Subject: [PATCH] attempt at #225 --- R/adwords.R | 6 +++++- R/googleAnalyticsR.R | 29 ++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/R/adwords.R b/R/adwords.R index 224fcad8..7c3e781b 100644 --- a/R/adwords.R +++ b/R/adwords.R @@ -56,10 +56,14 @@ ga_adwords_list <- function(accountId, #' @noRd #' @import assertthat +#' @importFrom dplyr bind_rows select parse_ga_adwords_list <- function(x){ + aaa <- Reduce(bind_rows, x$items$adWordsAccounts) o <- x %>% - management_api_parsing("analytics#entityAdWordsLinks") + management_api_parsing("analytics#entityAdWordsLinks") %>% + cbind(aaa) %>% + select(-adWordsAccounts, -entity.webPropertyRef.kind, -entity.webPropertyRef.href, -kind) if(is.null(o)){ return(data.frame()) diff --git a/R/googleAnalyticsR.R b/R/googleAnalyticsR.R index 3053ed51..17e92644 100644 --- a/R/googleAnalyticsR.R +++ b/R/googleAnalyticsR.R @@ -27,23 +27,26 @@ NULL ## horrible hack https://github.com/tidyverse/magrittr/issues/29 if(getRversion() >= "2.15.1") utils::globalVariables(c(".", - "id", - "parentLink.href", - "parentLink.type", + "adWordsAccounts", + "childLink.type", + "childLink.href", "created", - "updated", - "userRef.email", - "permissions.local", - "linkId", + "endTime", "entity.accountRef.id", "entity.webPropertyRef.id", "entity.profileRef.webPropertyId", "entity.profileRef.id", + "entity.webPropertyRef.kind", + "entity.webPropertyRef.href", + "id", + "kind", + "linkId", + "parentLink.href", + "parentLink.type", + "permissions.local", "selfLink", - "uploadTime", - "childLink.type", - "childLink.href", "startTime", - "endTime", - "kind", - "userRef.kind")) \ No newline at end of file + "updated", + "userRef.email", + "uploadTime", + "userRef.kind"))