Package 'r4googleads'

Title: 'Google Ads API' Interface
Description: Interface for the 'Google Ads API'. 'Google Ads' is an online advertising service that enables advertisers to display advertising to web users (see <https://developers.google.com/google-ads/> for more information).
Authors: Johannes Burkhardt [aut, cre], Matthias Bannert [aut]
Maintainer: Johannes Burkhardt <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2024-11-01 02:52:51 UTC
Source: https://github.com/banboo-data/r4googleads

Help Index


Authentication of R app

Description

get_credentials authenticates the R app at the 'Google' authentication server using OAUTH2 and receives the client token. Usually you need not to run get_credentials() explicitly since the whole authentication process is managed by authenticate.

Usage

.get_credentials()

Value

Client token from Google authentication server.


Loading the Access Token

Description

load_token loads the access token using credentials provided by another internal function (dot-get_credentials). Execution of function is possible only once per authentication process. Usually you need not to run load_token() explicitly since the whole authentication process is managed by authenticate.

Usage

.load_token(credlist)

Arguments

credlist

list of credentials

Value

Access token with corresponding time stamp


Refresh Access Token

Description

refresh_token returns a new valid access token. The access token deprecates after one hour and has to updated with the refresh token. Usually you need not to run refresh_token() explicitly since the whole authentication process is managed by authenticate.

Usage

.refresh_token(google_auth)

Arguments

google_auth

list of credentials and access token

Value

New access token with corresponding time stamp


Invoke the Authentication Process with 'Google'

Description

This function starts the authentication process with 'Google'. Note that this function needs user interaction.

Usage

authenticate(save = TRUE)

Arguments

save

logical, should the authentication information should be saved on disk? Defaults to TRUE.

Value

data.frame containing credentials, optionally saved as .RData in the current working directory


Prepare Curl Request

Description

Create

Usage

build_handle(x)

Arguments

x

object of class googleAdsSearch, googleAdsFields listAccessibleCustomers

Value

curl dandle object


Query Strings for Query Based Services

Description

A built-in collection of queries, mostly for the googleAdsSearch service: default_search(), campaign_sample(), adgroup_sample(), adgroup_sample_1(), hotel_ads_sample(), keyword_sample(), keyword_sample_1(), keyword_sample_2(). Usually these functions are not called stand alone. Often they are used when a constructor of a query based service is called. A 'Google Ads Query Builder' can be found here: https://developers.google.com/google-ads/api/fields/v9/overview_query_builder

Usage

default_search()

campaign_sample()

adgroup_sample()

adgroup_sample_1()

hotel_ads_sample()

keyword_sample()

keyword_sample_1()

keyword_sample_2()

Value

character query statement

Examples

default_search()
campaign_sample()
adgroup_sample()
adgroup_sample_1()
hotel_ads_sample()
keyword_sample()
keyword_sample_1()
keyword_sample_2()

Deprecated Function

Description

You were looking for a deprecated function. Very likely you have been a user of 'r4googleads' predecessor 'RAdwords' package. 'Google' phases out its 'Adwords API' and replaces it with the 'Google Ads API'. Hence, we have created the 'r4googleads' package. For more information please read our migration guide read our migration guide: Migration Guide

Usage

do_auth(...)

statement()

reports(...)

metrics(...)

get_data(...)

Arguments

...

arguments to to be passed on to the underlying functions. (note that this functions is deprecated, use authenticate().)

Value

message with deprecation notice

message with deprecation notice

message with deprecation notice

message with deprecation notice

message with deprecation notice


Construct googleAdsFields Class (S3)

Description

Create an instance of a googleAdsFields class. A list of Google's ads services and their arguments can be found here: https://developers.google.com/google-ads/api/rest/reference/rest/v9/googleAdsFields.

Usage

googleAdsFields(tbl, api_version = "v9")

Arguments

tbl

character table argument

api_version

Google Ads API version e.g 'v9'

Value

list; contains googleAdsFields Class information


Construct googleAdsSearch Class (S3)

Description

Create an instance of a googleAdsSearch class. A list of Google's ads services can be found here: https://developers.google.com/google-ads/api/rest/reference/rest.

Usage

googleAdsSearch(aid, query = default_search(), api_version = "v9")

Arguments

aid

character Google account id

query

character query string or function that returns a character query string. See also queries.

api_version

Google Ads API version e.g 'v9'

Value

list; contains googleAdsSearch Class information


Construct listAccessibleCustomers Class (S3)

Description

Create an instance of a listAccessibleCustomers class. https://developers.google.com/google-ads/api/rest/reference/rest/v9/customers/listAccessibleCustomers.

Usage

listAccessibleCustomers(api_version = "v9")

Arguments

api_version

Google Ads API version e.g 'v9'

Value

list; contains listAccessibleCustomers Class information


Query 'Google Ads' Data

Description

Sends 'Google Ads' Services objects to the 'Google Ads API'.

Usage

query_google_ads(
  mcc_id,
  google_auth,
  service,
  raw_data = FALSE,
  convert_micros = 1e+06
)

Arguments

mcc_id

Google Ads Client Center MCC Id

google_auth

auth object

service

googleAds service object created by a service constructor such as googleAdsSearch or googleAdsFields.

raw_data

TRUE / FALSE returns raw data or content only

convert_micros

converts micros data: divides data by 1e6, if NULL no conversion will be applied.

Value

Google Services return object either with raw or processed data (default).