Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

vapply error when using fetch.by = day and ga:sessionDuration #45

Open
lcormaw opened this issue Nov 4, 2016 · 0 comments
Open

vapply error when using fetch.by = day and ga:sessionDuration #45

lcormaw opened this issue Nov 4, 2016 · 0 comments

Comments

@lcormaw
Copy link

lcormaw commented Nov 4, 2016

Hi,

When using a fetch.by = day, here is the error and traceback:

Error in vapply(x, function(x) as.numeric(x[[name]]), numeric(1)) : 
  values must be length 1,
but FUN(X[[1]]) result is length 0
> traceback()
5: vapply(x, function(x) as.numeric(x[[name]]), numeric(1))
4: sum_by(pages, "sampleSize")
3: fetch_by(path, query, by, token)
2: get_report("data/ga", query, token, fetch.by)

The query was:

get_ga(profileId = ga_id,
            start.date = "2016-01-01",
            end.date = "2016-11-01",
            metrics = "ga:sessions,ga:bounces,ga:sessionDuration,ga:pageviews,ga:goal7Completions,ga:goal17Completions,ga:goal18Completions",
            dimensions = "ga:date,ga:yearMonth,ga:landingPagePath,ga:dcmClickSitePlacement,ga:dcmClickCampaign,ga:dcmClickSite",
            filters = "ga:dcmClickCampaign=~xxxxxxxx",
            fetch.by = "day"
)

After playing with the date range, it appears to be caused by the absence of data returned for one day (where the filter does not match anything). Is there any workaround to this without having to find the problematic date manually?

Thanks for your help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant