Reputation: 41
I am looking for a way to get keyword data from google Adwords clicks. I know I might get keyword data and more by with the Adwords API using the gclid and the CLICK_PERFORMANCE_REPORT. I haven't tried this yet but I will. https://developers.google.com/adwords/api/docs/appendix/reports#click
This is about data from my client campaigns, and I already have an access_token from my clients to access their Google Analytics account. I prefer not to also have them give our web application access to their Adwords Account.
My question is whether it is also possible to get access to the CLICK_PERFORMANCE_REPORT, or similar information, via the analytics API? The analytics accounts are connected with the clients Adwords account, I just prefer not to also ask them for access to their Adwords account.
So what I would like to achieve is log a visit from Adwords (on my clients' site to our database) and then (probably once per day) add keyword and campaign data to this. This while circumventing to ask access to my clients Adwords accounts.
Upvotes: 1
Views: 1439
Reputation: 2385
Assuming you know how to use R, here is a following piece of code that gets Adwords data from GA:
library(RGoogleAnalytics)
library(httpuv)
oauth_token <- Auth(client.id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com",
client.secret = "XXXXXXXXXXXXXXXXXXXX") # you need to get these from google
save(oauth_token,file="C:/Users/yschellekens.INTRANET/Desktop/Arrow electronics/using the developers API/token_file")
load("C:/Users/yschellekens.INTRANET/Desktop/Arrow electronics/using the developers API/token_file")
Profile<-GetProfiles(oauth_token)
query.visitors <- Init(start.date = "2014-06-01",
end.date = "2015-02-01",
dimensions = c("ga:fullReferrer","ga:referralPath","ga:keyword"),
metrics = c("ga:organicSearches"),
max.results = 10000,
table.id = "ga:52582227")
# Create the Query Builder object so that the query parameters are validated
# Extract the data and store it in a data-frame
ga.visitors <- GetReportData(QueryBuilder(query.visitors), oauth_token)
table(ga.visitors$hasSocialSourceReferral)
For more info on the metrics, see the following: https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=adwords
Hope this helps!
Upvotes: 0