traffic.estimator.parser: XML Parsing for the Traffic Estimator Service.

Description Usage Arguments Details Value Examples

View source: R/traffic.estimator.parser.R

Description

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.

Usage

1
2
3
4
5
6
7

Arguments

x

traffic.estimator response in XML.

Details

There's also a parse function for traffic.estimator.request to convert the requests a list of campaign.estimate.request.

Value

A data.frame with the estimate results.

Examples

 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)

adviso/RAdwordsPlus documentation built on Dec. 5, 2019, 3:11 a.m.