Coder Social home page Coder Social logo

radwords's Introduction

RAdwords

RAdwords Cran Release RAdwords Cran Downloads

Buy Me A Coffee

Loading Google Adwords data into R

RAdwords is a R package with the aim to load Adwords data into R. Therefore the package implements three main features. First, the package provides an authentication process for R with the Adwords API via OAUTH2. Second, the package offers an interface to apply the Adwords query language in R and query the Adwords API with ad-hoc reports. Third, the received data are transformed into suitable data formats for further data processing and data analysis.

❗❗ Google AdWords API Sunset ❗❗

The Google AdWords API will sunset on April 27, 2022.
Upgrade to the Google Ads API with our new R package {r4googleads}. Follow our RAdwords Migration Guide.

Documentation

We provide a detailed documentation here: RAdwords Documentation

Quickstart Guide

The following section helps you to get started straight away.

Installation

The package can be installed from CRAN

install.packages("RAdwords")

or directly from this Github repository with:

require(devtools)
install_github('jburkhardt/RAdwords')

Usage

Requirements:

In order to access the Adwords API you have to set up a Google API project for native apps. The Google API project provides a Client Id and Client Secret which is necessary for the authentication. Moreover you need to have a Adwords MCC with an Adwords developer token.

Authentication:

The function doAuth manages the complete authentication process. Meaning doAuth authenticates the R app for the first time, loads the access token or refreshes the access token if expired. Hence, you only run doAuth() to authenticate whether it is your initial R Session or a later instance.

What's happening in details?

Once the API projects for native application is set up, getAuth is able to authenticate the R app with the credentials (Client Id, Client Secret) from the Google API project. The Google authentication server returns a client token, which later is used by loadToken to receive the access token. If the access token is expired after one hour, it can be updated with refreshToken. The access token in combination with the Adwords developer token enables a connection with the Adwords API.

Create Statement:

statement creates the Adwords Query Language Statement.

Loading Data:

getData queries the data from the Adwords API and transforms the data into an R dataframe.

Example

Authentication

library(RAdwords)
google_auth <- doAuth()

Create Statement

body <- statement(select = c('Clicks', 'AveragePosition', 'Cost', 'Ctr'),
                  report = "ACCOUNT_PERFORMANCE_REPORT",
                  start = "2018-01-01",
                  end = "2018-01-10")

Query Adwords API and get data as dataframe

# make sure to use the Adwords Account Id (MCC Id will not work)
data <- getData(clientCustomerId = 'xxx-xxx-xxxx',
                google_auth = google_auth,
                statement = body)

Get available report types

reports()

Get available metrics/attributes of specific report type

metrics(report = 'ACCOUNT_PERFORMANCE_REPORT')

radwords's People

Contributors

brurucy avatar djuery avatar jburkhardt avatar mbannert avatar refik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radwords's Issues

* Hostname was NOT found in DNS cache

Hans,

I received this email of Austin who was able to connect but had trouble to actually get data from google.
He also posted to SO and I thought we should move the question here, as this is kinda specific for SO.

Matthias,

Was hoping you could help me, I am running RAdwords and I can connect, but all attempts at pulling data get the same error message - thanks for the help and awesome tool!

   body <- statement(select=c('KeywordText','Clicks','Cost','Ctr'),
   report="KEYWORDS_PERFORMANCE_REPORT", 
   where="Clicks > 100",
   start="20150101",
   end="20150301")

   data <- getData(clientCustomerId='949-xxx-xxxx', google_auth=google_auth,
   statement=body, transformation = TRUE)
  • upload completely sent off: 88 out of 88 bytes

< HTTP/1.1 400 Bad Request

< Content-Type: text/xml

< Date: Fri, 06 Mar 2015 19:27:20 GMT

< Expires: Fri, 06 Mar 2015 19:27:20 GMT

< Cache-Control: private, max-age=0

< X-Content-Type-Options: nosniff

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< Server: GSE

< Accept-Ranges: none

< Vary: Accept-Encoding

< Transfer-Encoding: chunked

<

  • Connection #0 to host adwords.google.com left intact

Error in 1:ncol(data) : argument of length 0

Worrying problem in Shopping Campaigns reports

Hi @jburkhardt, @mbannert, and first of all many thanks for this incredible RAdwords package.

I noticed a very disturbing bug in the transformData.R file. The problem is impacted by this part of code:

else if (ncol(data) > 1) {
        data <- data[-1, ]
        data <- data[-nrow(data), ]
    }

The data <- data[-nrow(data), ] code should be, as expected, removing the Total lines from the data.frame, which is a good thing.
However, I noticed that when using a PRODUCT_PARTITION_REPORT, the last line isn't at all the Total line but a real partition line. data <- data[-nrow(data), ] is thus removing a real report line, which may have serious consequences on the result, especially when working with RoI or cost data.

My suggestion is therefore to change:

data <- data[-nrow(data), ]

with

if(reportType != "PRODUCT_PARTITION_REPORT") {
  data <- data[-nrow(data), ]
}

or even

if(data[nrow(data), 1] == "Total") {
  data <- data[-nrow(data), ]
}

to ensure this works for every non-total-like report, if you see what I mean.

Many thanks in advance!

Damien

Label report should have no DURING clause

Fetching the label report gives an error as statement() adds default DURING clause which should not be included for the label report. Works fine if the statement is modified manually to remove the DURING clause.

Will not work

labelReportQuery <- statement(select=c('LabelName'), report = "LABEL_REPORT")

Works if labelQuery is modified

labelReportQuery[1] <- "__rdquery=SELECT+LabelName+FROM+LABEL_REPORT&__fmt=CSV"

Does not work correctly with the Cyrillic alphabet

Hello.
Faced with the fact that does not work correctly with the Cyrillic alphabet, if returned value contains Cirillic letter "я" or "Я" API request is break and returned truncate result.

For Example:

http://picsee.net/upload/2016-04-04/6d34c8b09c7e.jpg

Hostname was NOT found in DNS cache / HTTP/1.1 400 Bad Request

Hello,

I got the same error message as Austin (#13) but could not figure out how to downgrade or upgrade my curl version in order to fix the error.

Trying on OS X Yosemite 10.10.4, R 3.2.1, Curl 7.37.1

  • upload completely sent off: 115 out of 115 bytes
    < HTTP/1.1 400 Bad Request
    < Content-Type: text/xml
    < Date: Fri, 14 Aug 2015 17:31:52 GMT
    < Expires: Fri, 14 Aug 2015 17:31:52 GMT
    < Cache-Control: private, max-age=0
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: SAMEORIGIN
    < X-XSS-Protection: 1; mode=block
  • Server GSE is not blacklisted
    < Server: GSE
    < Accept-Ranges: none
    < Vary: Accept-Encoding
    < Transfer-Encoding: chunked
    <
  • Connection #0 to host adwords.google.com left intact
    Error in 1:ncol(data) : argument of length 0

Can you please advise?

Thanks!

ADS_PERFORMANCE_REPORT warning message. Not downloading full data

I am unable to pull all ads in my account. It pulls some then shows a warning message. Is this a ram or memory issue? How do I overcome this to download all ad data? I am able to download much more observations in keywords report with no problem.

Here is the warning message:
Warning messages:
1: In nchar(str) * 4L : NAs produced by integer overflow
2: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
EOF within quoted string

Here is my code:
adbody <- statement(select=c('CampaignName','CampaignStatus', 'AdGroupName','AdGroupStatus','Id','Status','Headline', 'Description1', 'Description2', 'Clicks','Cost','DisplayUrl',"Url"),
report="AD_PERFORMANCE_REPORT", start=start, end=end)
addata <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=adbody)

Error in `[.default`(xj, i) :

"only 0's may be mixed with negative subscripts"

I'm getting the above messages after successfully authenticating and running the same query you have in the example.

body <- statement(select=c('Clicks','AveragePosition','Cost','Ctr'),
report="ACCOUNT_PERFORMANCE_REPORT",
start="2014-03-20",
end="2014-03-21")
google_auth <- doAuth()
getData(clientCustomerId = "my-client's-id", google_auth = google_auth, statement = body)

RAdwords Package Version: 0.1.7
MacOSX El Capitan
RStudio version: 0.99.875 (had the same issue in the previous version as well)

Can you please check or let me know if I'm missing something?

Thanks a lot!

Can't retrieve data from API

Hi Johannes,

I installed RAdwords yesterday but I can't seem to make it work. I checked all bug reports and the CRAN documentation but I'm not sure if there's something I'm missing.

To summarise, I have:

  • MAC OSX
  • R Studio v. 0.99.1294
  • I downloaded RAdwords from the GitHub repo
  • I have Basic API access with my Manager Account

This is the code I'm running. I'm using the customer ID for the client's account whose data I'm trying to retrieve. I'm NOT using my Manager Account ID.

`google_auth <- doAuth(save = TRUE)

adbody <- statement(select = c("Impression", "Clicks"),
report = "AD_PERFORMANCE_REPORT",
start = "20160801",
end = "20160802")

df <- getData(clientCustomerId = "xxx-xxx-xxxx", google_auth = google_auth, statement = adbody)`

And this is the error I'm getting.

screen shot 2016-09-02 at 09 45 33

I was wondering was the INVALID_FIELD_NAME_FOR_REPORT error means as well as if it may have something to do with the transformData function? I'm confused by the example in the documentation.

screen shot 2016-09-02 at 09 59 25

Thanks for your help!

Unknown SSL protocol erro

Hello,
Sometimes I'm getting this error using the RAdwords.

Error in function (type, msg, asError = TRUE) :
Unknown SSL protocol error in connection to adwords.google.com:443

My code save the Rsession and afterthat I reuse the google authorization. Do you know which could be the problem?

Best.

Best Method to Pull Ad Group Level Bid Adjustments

Was wondering the best way to do this? Because the ADGROUP_PERFORMANCE_REPORT does not have the option, the CRITERIA_PERFORMANCE_REPORT seems the most relevant. However when pulling data this column just shows "--". But there actually is a modifier in place. Is there another report I should be using for this or is this maybe a bug? -- it was hard to find.

body <- statement(select=c('BidModifier','CampaignName','AdGroupName','Clicks', 'Impressions', "AveragePosition", 'Cost','ConvertedClicks'),
                    report="CRITERIA_PERFORMANCE_REPORT",
                    start=start1, end=end1)
 data <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=body)

Pulling QS from CRITERIA_PERFORMANCE_REPORT

Im just trying to pull quality score data at at the account or campaign level. Unfortunatley even without selecting, it parses by day or keyword. Something makes the request a lot longer than it needs to be....

body <- statement(select=c('AccountDescriptiveName', 'CampaignName',  'QualityScore', 'Clicks' ),
report="CRITERIA_PERFORMANCE_REPORT", start=start, end=end)
data <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=body)

google_auth issues

Hi Johannes,

Relatively new to R language in general and have just come across a road block at this line
data <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=body)
"google_auth=google_auth" <---Should i be placing an access token here?
What data should i be placing within this line of code?

Sorry for the noobish question, appreciate it!

Not Able to Download New Attributes

There are a few relatively new attributes that I am not able to download through RAdwords. The "Est. add. clicks/wk" (-50%, +50%, +300%), "Est. add. cost/wk" (-50%, +50%, +300%), and "Base max. CPC" attributes would be super helpful for the Keywords and Product Partition reports. You can currently download them manually from the AdWords reporting UI. Any way we can pull these for unique keyword and product group in RAdwords?

Can't download data

I'm getting this error after I authenticate with Google API and AdWords Developer Token.

Do you know how can I fix this issue?

data <- getData(clientCustomerId = *****, google_auth = Adwords,

  •                    statement = report)
    
  • Trying 64.233.177.113...
  • Connected to adwords.google.com (64.233.177.113) port 443 (#0)
  • TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  • Server certificate: adwords.google.com
  • Server certificate: Google Internet Authority G2
  • Server certificate: GeoTrust Global CA
  • Server certificate: Equifax Secure Certificate Authority
    POST /api/adwords/reportdownload/v201506 HTTP/1.1
    Host: adwords.google.com
    Accept: /
    Authorization: Bearer *****************
    developerToken: ***************
    clientCustomerId: ***************
    Content-Length: 358
    Content-Type: application/x-www-form-urlencoded
  • upload completely sent off: 358 out of 358 bytes
    < HTTP/1.1 400 Bad Request
    < Content-Type: text/xml
    < Date: Sun, 27 Sep 2015 23:07:20 GMT
    < Expires: Sun, 27 Sep 2015 23:07:20 GMT
    < Cache-Control: private, max-age=0
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: SAMEORIGIN
    < X-XSS-Protection: 1; mode=block
    < Server: GSE
    < Accept-Ranges: none
    < Vary: Accept-Encoding
    < Transfer-Encoding: chunked
    <
  • Connection #0 to host adwords.google.com left intact
    Error in [.default(xj, i) :
    only 0's may be mixed with negative subscripts

get keywords

With the api 201601

Sending the requeset
query_conversion <- statement(select=c('KeywordText','Clicks','Cost','Ctr'),
report="KEYWORDS_PERFORMANCE_REPORT",
start=begin_data,
end=end_data)

##25
data_conversion <- getData(clientCustomerId=account, google_auth=google_auth ,statement=query_conversion)

I'm getting the following error. I think that the problem is KeywordText

"ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORTKeywordText"
1

R 3.1.3 dependency

Sorry for the lame question, but can you please let me know why depending on R 3.1.3? I am a happy user of R 3.1.2 and have not seen any issues with the package.

NAs introduced by coercion

I keep getting errors when trying to download the Headline, Description line 1 and destination url for search ads:

Here's my statement:
body <- statement(select=c('AccountDescriptiveName','CampaignName','AdGroupName','Headline','Description1','Description2','DisplayUrl','CreativeDestinationUrl'),
report="AD_PERFORMANCE_REPORT",
start=thirtydays,
end=yesterday)

Any ideas what might be causing this to happen?

AD_PERFORMANCE_REPORT

I'm calling the following code:

query_traffic <- statement(select=c('Date','Device','AdType','AccountDescriptiveName','CampaignName','AdGroupName','AdGroupStatus','Status'),
report="AD_PERFORMANCE_REPORT",
start=today,
end=today)

try_backoff(data_traffic <- getData(clientCustomerId=account, google_auth=google_auth ,statement=query_traffic),verbose = TRUE, max_attempts = 5)

It works properly but when all the metrics in an ad are equals to zero this will not is included in the data. It is excluded. Right?

Always Get Bad Request since last update

Hi, i've forked and used this awesome code for a while.

I dont understand exactly why, but something hapened and now I always get an Error: Bad request when i query the API, including when i am using your example code.

image

Any clues?

Shopping campaign reports and zero impressions

Hi @jburkhardt,

further to my previous issue, I noticed another problem when querying Shopping Campaign reports (like PRODUCT_PARTITION_REPORT or SHOPPING_PERFORMANCE_REPORT) with Zero Impressions.

Normally, when you use getData to download the data from Google AdWords, you include the parameter where = "Impressions >= 0" into the statement function if you want the AWQL predicate to include Zero Impressions. However, for some reason, this is with zero effect for these Shopping Campaign reports.

The only way of doing it is to force the parameter directly into the httpheader from RCurl::getURL function. In other terms, one has to write the httpheader like this:

httpheader = c(Authorization = google.auth,
    developerToken = credlist$auth.developerToken,
    clientCustomerId = clientCustomerId,
    includeZeroImpressions = TRUE)

Please find below the exact reference (AdWords API Dev Doc):
https://developers.google.com/adwords/api/docs/guides/zero-impression-reports#explicitly_including_zero_impressions

Therefore, my suggestion is to add a parameter into the getData function, that could be called forceZeroImpressions, and re-write the whole file getData.R as follows:

function (clientCustomerId, google_auth, statement, apiVersion = "201509", 
    transformation = TRUE, changeNames = TRUE, forceZeroImpressions = FALSE, verbose = FALSE) 
{
    access <- google_auth$access
    credlist <- google_auth$credentials
    if (as.numeric(Sys.time()) - 3600 >= access$timeStamp) {
        access <- refreshToken(google_auth)
    }
    google.auth <- paste(access$token_type, access$access_token)
    cert <- system.file("CurlSSL", "ca-bundle.crt", package = "RCurl")

    if (forceZeroImpressions == TRUE) {
      data <- RCurl::getURL(paste("https://adwords.google.com/api/adwords/reportdownload/v", 
          apiVersion, sep = ""), httpheader = c(Authorization = google.auth, 
          developerToken = credlist$auth.developerToken, clientCustomerId = clientCustomerId, includeZeroImpressions = TRUE), 
          postfields = statement, verbose = verbose, cainfo = cert, 
          ssl.verifypeer = TRUE)
    } else {
      data <- RCurl::getURL(paste("https://adwords.google.com/api/adwords/reportdownload/v", 
          apiVersion, sep = ""), httpheader = c(Authorization = google.auth, 
          developerToken = credlist$auth.developerToken, clientCustomerId = clientCustomerId), 
          postfields = statement, verbose = verbose, cainfo = cert, 
          ssl.verifypeer = TRUE)
    }

    if (transformation == TRUE) {
        data <- transformData(data, report = attributes(statement)$reportType, 
            apiVersion = apiVersion)
        if (changeNames == TRUE) {
            data <- changeNames(data)
        }
    }
    data
}

Many thanks for taking this into consideration, as this will certainly improve the package!

Cheers,
Damien

How to use doAuth in a script that in scheduled as a cron job

My script runs fine in Rstudio, however, I keep getting,

Authentication process needs your Client ID from the Adwords API project for native apps Paste the Client ID here

when I run my script as a cron job.

I see that the documentation says that this function requires user interaction but I believe I've been able to run it through cron before. It somehow started throwing this very recently.

Also, When I run this script in rstudio, it never really asks me to provide a client ID as such. Where has it been getting the client ID from?

I've been using it like:

google_auth <- doAuth(save = T);

and
I've a file in my working directory, .google.auth.RData. I've also seen that if I first load this file,

load("/home/rstudio/.google.auth.RData")

and comment out doAuth, I don't get this error through cron either but I believe it can't work since the access token is going to expire in an hour or so.

How do I do it? How I've been able to use doAuth for a cron up until now and why does it never ask for client ID when I run it thorough Rstudio?

I've made all my files executable in my working directory so sure the cron job should be able to access any files that are there.

How to make this work?

statment date range

Instead of using specific start and end dates. Is there a way to declare date ranges as in the AdWords UI? e.g. Last 7 days, last 30 days, this month, last month...

Shopping performance report issue

Hi @jburkhardt,

hope you're well.

As I feared in my previous messages, I just wanted to inform you that the SHOPPING_PERFORMANCE_REPORT does not have a total line at the bottom of the report, meaning that again there is an issue in the transformData file because it will purely remove a real report line.

My solution is therefore to change:

if (report != "PRODUCT_PARTITION_REPORT") {
  data <- data[-nrow(data), ]
}

line in it with:

if(report != "PRODUCT_PARTITION_REPORT" & report != "SHOPPING_PERFORMANCE_REPORT") {
  data <- data[-nrow(data), ]
}

However, I maintain that this replacement:

if(data[nrow(data), 1] == "Total") {
  data <- data[-nrow(data), ]
}

is preferred, as it would ensure that the fix works for every report type whose last line is not a Total line.

Many thanks for the implementation!

Cheers,
Damien

Problem with GEO_PERFORMANCE_REPORT

When I create my query to pull info from the geo performance report, it doesn't return any data.

Here's the query (minus the client ID):
body <- statement(select=c('Date', 'Impressions', 'Clicks', 'RegionCriteriaId'),
report="GEO_PERFORMANCE_REPORT",
where="Impressions >0",
start="20130101",
end="20141229")
data <- getData(clientCustomerId='xxx-xxx-xxxx',statement=body,transformation=TRUE, google_auth=google_auth)

Here's the result:

str(data)
'data.frame': 0 obs. of 29 variables:
$ NA: Factor w/ 1 level "SelectorError.MISSING_FIELDS<trigg"| truncated:
$ NA: Factor w/ 1 level " CustomFeatureCriteriaId":
$ NA: Factor w/ 1 level " CustomOtherCriteriaId":
$ NA: Factor w/ 1 level " CustomCountryCriteriaId": ......

Querying Criterion.Type

When I'm pulling metrics for the AUDIENCE_PERFORMANCE_REPORT, I can pull the Audience or the CriterionID.

For example, the audience may be uservertical::80182, which is /Autos & Vehicles/Motor Vehicles/Motor Vehicles by Type/Off-Road Vehicles/Off-Road Vehicles (New), here: http://goo.gl/HJiK99.

Is it possible in in your package to also query the CriterionUserInterest to return the name of the Audience?

I've also noticed similar results when pulling geographic reports, it might possible be done in the same manner.

tryCatch

  • check whether we should make use of tryCatch blocks for better error handling

Error while using getData

I am recieving the following error while using get data, same query used work previously, is there is any thing changed in RAdwords package.

<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><reportDownloadError><ApiError><type>ReportDownloadError.MISSING_PARAMETER</type><trigger>Missing report definition</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>

KEYWORDS_PERFORMANCE_REPORT, CPC Bid showing as "NA"

Not sure why, but all my Max. CPC bids are not pulling down for a keyword report. Is this a known issue or am I pulling it wrong?

perfbody <- statement(select=c('AccountDescriptiveName','Date', 'Device', 'CampaignName', 'KeywordText', 'CpcBid', 'AdGroupName','KeywordMatchType', 'Clicks', 'Cost', 'Conversions', 'ConversionValue'),
report="KEYWORDS_PERFORMANCE_REPORT", start=start, end=end)
perfdata <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=perfbody)

Not able to import data

data <- getData(clientCustomerId="Account ID", google_auth=google_auth ,statement=body)

Error in if (data[nrow(data), 1] == "Total") { :
argument is of length zero

Account ID I am using is the Customer Id of the account whose Client ID and secret I am using.
Please help.

getauth

I've just downloaded and installed R, then I've run require(devtools) install_github('jburkhardt/RAdwords') and got a few success messages. But when I try to run doauth() it returns an error saying that it couldn't find the function "getAuth". Is there some intermediate step I should have done before doauth? Thanks a lot for this project!

Error with LABEL_REPORT -> DURING_CLAUSE_REQUIRES_DATE_COLUMN

Hi,

I'm trying to retrieve a list of IDs of the labels of my account (I need to use then as filter, the API does not accept filtering by the LabelName) but I'm having some errors.

The query:

test <- statement(select=c('LabelName','LabelId'),
                    report="LABEL_REPORT",
                    start="20160711",
                    end="20160727")
test2 <- getData(clientCustomerId='XXX-XXX-XXX', google_auth=adw_auth, statement=test)

test2

The error I receive:

"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><reportDownloadError><ApiError><type>QueryError.DURING_CLAUSE_REQUIRES_DATE_COLUMN</type><trigger></trigger><fieldPath></fieldPath></ApiError></reportDownloadError>"

I'm using the RAdwords 0.1.10

It's something I'm doing wrong?

Thanks, Diego

HTTP/1.1 400 Bad Request

After successfully authenticating, Could not download any data. Can you please help?

image

Output:

* upload completely sent off: 116 out of 116 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: text/xml
< Date: Fri, 15 Apr 2016 12:13:42 GMT
< Expires: Fri, 15 Apr 2016 12:13:42 GMT
< Cache-Control: private, max-age=0
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< Server: GSE
< Accept-Ranges: none
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< 
* Connection #0 to host adwords.google.com left intact
Error in `[.default`(xj, i) : 
  only 0's may be mixed with negative subscripts

ACCOUNT_PERFORMANCE_REPORT Showing NA's for Conversion Value

I've been running the same script for a while. Conversion value is no longer being passed and resulting in NAs. I receive the Warning message: NAs introduced by coercion. Here is my script.

# specify date range, i.e. last 7 days until yesterday is equivalent to LAST_7_DAYS
start <- gsub("-","",format(Sys.Date()-7,"%Y-%m-%d")) #start 7 days ago
end <- gsub("-","",format(Sys.Date()-1,"%Y-%m-%d")) #until yesterday

#pull AdWords data
body <- statement(select=c('Date', 'Device','ConversionValue', 'Cost', 'ConvertedClicks', 'Clicks'),
report="ACCOUNT_PERFORMANCE_REPORT", start=start, end=end)
data <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=google_auth ,statement=body)

Error in subset with API version change

I started getting this error this morning:

Error in subset(reportType, Type == "Double") : 
  object 'reportType' not found

with change in apiVersion. It looks like it by default uses 201603 which now has been deprecated.
If I do not pass apiVersion in getData call, it gives:

"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><reportDownloadError><ApiError><type>RequestError.UNSUPPORTED_VERSION</type><trigger>You are accessing an AdWords API version v201603 that has been discontinued. Calls to this version may fail. Please visit the AdWords API blog for information on migration to the new AdWords API version.</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>" in response to every API call.

If I instead change it to 201605 it gives error is subset error.I tried it for Campaign performance reports and some others as well but I keep getting it irrespective of the report I am trying to download.

Similarly, if I pass apiVersion to reports function:

xyz <- RAdwords::reports(apiVersion = "201605")
print(xyz)

it gives:

Error in sub(".csv", "", reportTypes) : object 'reportTypes' not found
On other hand If I pass

xyz <- RAdwords::reports(apiVersion = "201603")
print(xyz)

it works
Looks like the problem here is with the version that gets passed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.