Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. # 1. Download des Packages
  2. install.packages("googleAnalyticsR")
  3.  
  4. # 2. Aktivieren des PAckages
  5. library(googleAnalyticsR)
  6.  
  7. # 3. Authentifizierung
  8. ga_auth()
  9.  
  10. # 4. Abfrage
  11. data<-google_analytics_3(
  12. "VIEWID",
  13. start = '2019-01-01',
  14. end = '2019-06-01',
  15. dimensions = c("date", "deviceCategory", "country"),
  16. metrics = c("sessions", "bounceRate", "hits"),
  17. filters = c("ga:deviceCategory=~desktop|mobile"),
  18. max_results = 9999999
  19. )
  20.  
  21. # 5. Daten ansehen
  22. View(data)
  23.  
  24. # 6. Daten als csv Exportieren
  25. write.csv2(data, "meinDatenexport.csv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement