Last active
August 29, 2015 14:08
-
-
Save MarkEdmondson1234/b722aba26f8ca7d49379 to your computer and use it in GitHub Desktop.
Get the GA data for a profile
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
## pull in the GA data | |
# get list of profiles | |
profiles <- ga$getProfiles() | |
# View the profiles table, and pick the profile you want and put in the profile ID below | |
UA <- "XXXXXXX" | |
# choose the dates you want to pull in data for | |
date_before = "2014-09-01" | |
date_after = "2014-10-01" | |
# pull out traffic - in this case SEO visits by date | |
gadata <- ga$getData(ids = UA, | |
start.date = date_before, | |
end.date = date_after, | |
metrics = "ga:visits", | |
dimensions = "ga:date", | |
sort = "ga:date", filters = "ga:medium==organic", segment = "", | |
start = 1, max = 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment