Description Usage Arguments Details Value Examples
View source: R/traffic.estimator.parser.R
Parses a traffic.estimator response in XMl format into a data frame containing the results of the request.
The data frame is in long format.
Use dcast in package reshape2 with formula = CampaignID + AdgroupID + KeywordID ~ Metric
and value.var = "Value"
to get a data.frame in wide format.
1 2 3 4 5 6 7 | traffic.estimator.parser(x, ...)
campaign.estimate.parser(node, default.id = NULL)
adgroup.estimate.parser(node, default.id = NULL)
keyword.estimate.parser(node, default.id = NULL)
|
x |
traffic.estimator response in XML. |
There's also a parse function for traffic.estimator.request to convert the requests a list of campaign.estimate.request.
A data.frame with the estimate results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # For this exemple to work, you must supply a valid client customer id and your developper token
library(RAdwords)
k <- keyword(c("Example", "Test"), match.type = c("EXACT", "PHRASE"))
ker <- keyword.estimate.request(k, max.cpc = c(1500000, 2250000))
aer <- adgroup.estimate.request(ker)
cer <- campaign.estimate.request(aer, campaign.id = "123456789")
request <- traffic.estimator.request(cer)
estimate <- get.service(request, cid = "YOUR_CID", auth = doAuth(), dev.token = "YOUR_DEV_TOKEN", user.agent = "AKTE Exemple")
# Parse the request to get back the data
parse(request)
# Parse the estimate to get the results
traffic.estimator.parser(estimate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.