MyNixOS website logo
Description

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.

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)
Metadata

Version

0.3.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows