adwordsR v0.3.1

0

Monthly downloads

0th

Percentile

Access the 'Google Adwords' API

Allows access to selected services that are part of the 'Google Adwords' API <https://developers.google.com/adwords/api/docs/guides/start>. 'Google Adwords' is an online advertising service by 'Google', that delivers Ads to users. This package offers a authentication process using 'OAUTH2'. Currently, there are two methods of data of accessing the API, depending on the type of request. One method uses 'SOAP' requests which require building an 'XML' structure and then sent to the API. These are used for the 'ManagedCustomerService' and the 'TargetingIdeaService'. The second method is by building 'AWQL' queries for the reporting side of the 'Google Adwords' API.

Readme

adwordsR

adwordsR: R package for accessing the Google Adwords API.

This package provides an authetication process for the Google API via OAUTH2. It also accesses the API using SOAP requests and building XML files. Currently, there is only the Managed Customer Service service is supported through the package, however further packages are planned to built into the package.

Guide

You will need an MCC account in Adwords, which can be simply created. Through your MCC, you can apply for an Adwords Developer Token, to gain access to the API. You will also need a Client ID and Client Secret. To get these, you will need to set up a Google API project, which will provide you with a Client ID and Secret.

Authentication

To load or generate your Adwords Authentication token:

credentials <- loadAdwordsToken()

If you already have a token in your working directory, then this will be loaded using this command. If not, a token will be generated provided you enter the correct authentication details.

To check your Authentication token:

credentials <- checkAdwordsToken()

This will refresh the token if it has expired.

Example: Build your requests

To access the API, you need to build your XML request. This is not necessary for the reporting side of the API.

For Reporting:

Please note that this is a basic example and does not represent the full functionality. Please reference the help documentation for each R function.

credentials <- loadAdwordsToken()

credentials <- checkAdwordsToken()

data <- getReportData("KEYWORDS_PERFORMANCE_REPORT", 
                      "2018-01-01", 
                      "2018-02-01", 
                      "123-123-4567", 
                      credentials, 
                      attributes = c("Criteria", 
                                     "Date", 
                                     "Impressions"))

For Other Services

Please note that this is a basic example and does not represent the full functionality. More complex XML queries can be built. Please reference the help documentation for each R function.

credentials <- loadAdwordsToken()

xml <- buildXmlEnvelope("123-123-1234",  
                        "myUserAgent", 
                        credentials$adwordsDeveloperToken, 
                        "ManagedCustomerService", 
                        c("CustomerId", 
                          "Name"))                       

credentials <- checkAdwordsToken()

data <- getXmlRequest("ManagedCustomerService", 
                      xml,
                      credentials)

Functions in adwordsR

Name Description
checkAdwordsToken Check Adwords Token
addToGitignore Add to .gitignore
generateAdwordsToken Initial Adwords Token
apiDetails Google API Authentication Details
buildXmlEnvelope Build XML Envelope
refreshAdwordsToken Refresh Adwords Token
buildXmlHeader Build XML Header
TargetingIdeaService_relatedToUrlSearchParameter TargetingIdeaService - Related to URL Search Parameter
loadAdwordsToken Load Adwords Token
buildAwqlStatement AWQL Statement
TargetingIdeaService_searchVolumeSearchParameter TargetingIdeaService - Search Volume Search Parameter
buildXmlBody Build XML Body
getXmlRequest Send XML Request
getReportData Retrieve Adwords Data
TargetingIdeaService_get TargetingIdeaService - Get
ManagedCustomerService_get Customer Manager Service Get Request
TargetingIdeaService_ideaTextFilterSearchParameter TargetingIdeaService - Indea Text Filter Search Parameter
ManagedCustomerService_serviceSelector Customer Manager Service Selector
TargetingIdeaService_languageSearchParameter TargetingIdeaService - Language Search Parameter
TargetingIdeaService_seedAdGroupIdSearchParameter TargetingIdeaService - Seed Ad Group Id Search Parameter
TargetingIdeaService_networkSearchParameter TargetingIdeaService - Network Search Parameter
TargetingIdeaService_selector TargetingIdeaService - Selector
TargetingIdeaService_paging TargetingIdeaService - Paging Request
TargetingIdeaService_includeAdultContentSearchParameter TargetingIdeaService - Include Adult Content Search Parameter
TargetingIdeaService_ideaType TargetingIdeaService - Idea Types
TargetingIdeaService_searchParameters TargetingIdeaService - Search Parameter
TargetingIdeaService_locationSearchParameter TargetingIdeaService - Location Search Parameter
TargetingIdeaService_requestType TargetingIdeaService - Request Types
TargetingIdeaService_requestedAttributeTypes TargetingIdeaService - Attribute Types
TargetingIdeaService_categoryProductsAndServicesSearchParameter TargetingIdeaService - Category Products and Services Search Parameter
TargetingIdeaService_relatedToQuerySearchParameter TargetingIdeaService - Related to Query Search Parameter
TargetingIdeaService_competitionSearchParameter TargetingIdeaService - Competition Search Parameter
No Results!

Last month downloads

Details

Type Package
License MIT + file LICENSE
Encoding UTF-8
LazyData true
URL https://www.branded3.com/
RoxygenNote 6.0.1
Date 2018-06-19
NeedsCompilation no
Packaged 2018-06-19 10:12:45 UTC; Sean.Longthorpe
Repository CRAN
Date/Publication 2018-06-19 13:48:14 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/adwordsR)](http://www.rdocumentation.org/packages/adwordsR)