Created
September 22, 2015 04:50
-
-
Save MarkEdmondson1234/ce5aea57e8a954082b7d to your computer and use it in GitHub Desktop.
For Machine Learning and Web Analytics blogpost http://markedmondson.me/intro-to-machine-learning-with-web-analytics-random-forests-and-k-means
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(googleAnalyticsR_public) | |
gar_auth(new_user=T) | |
## your profile view Id | |
id <- "XXXXXX" | |
## 61607 results | |
## 30049 unique Ids | |
## 185 Sku's | |
product_views <- google_analytics(id, "2015-08-07", "2015-09-01", | |
metrics = 'productDetailViews', | |
dimensions = c('productSku','dimension1'), | |
samplingLevel = "WALK") | |
## 8855 results | |
## 6336 unique Ids | |
## 169 Sku's | |
product_trans <- google_analytics(id, "2015-08-07", "2015-09-01", | |
metrics = c('itemRevenue','uniquePurchases'), | |
dimensions = c('transactionId','productSku','dimension1')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment