0

I use script for Google Analytics auth from here with small changes:

library(googleAuthR)
library(googleAnalyticsR)

setwd("C:/seo_bi")

file.exists('humbertoharbert.json')

gar_auth_service(
  json_file = 'humbertoharbert.json',
  scope = "https://www.googleapis.com/auth/analytics"
)

And get an exeption:

> file.exists('humbertoharbert.json')
[1] TRUE
> gar_auth_service(
+   json_file = 'humbertoharbert.json',
+   scope = "https://www.googleapis.com/auth/analytics"
+ )
Error in normalizePath(path.expand(path), winslash, mustWork) : 
  path[1]="": The filename, directory name, or volume label syntax is incorrect

File is in the working directory. The filename is correct. OS is Windows 10. Cannot find the solution. Please, help.

UPD. Result for function from exeption:

 >normalizePath(path.expand('humbertoharbert.json'))
[1] "C:\\seo_bi\\humbertoharbert.json"
Community
  • 1
  • 1
Ivan Kutas
  • 171
  • 2
  • 7

1 Answers1

0

There was bug with service account file. There was no private_key in it. I changed json file for correct one and now script works.

Ivan Kutas
  • 171
  • 2
  • 7