oas_geo_inventory: Retrieve Geo Inventory Reports

Description Usage Arguments Value Note Examples

Description

This function returns a data.frame of inventory stats and forecasts broken down by a specified geography

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
oas_geo_inventory(credentials, 
                                report_type=c('Site', 
                                              'Section'), 
                                report_geo=c('Executive Summary', 'Continent', 
                                             'Country', 'State', 
                                             'City', 'Postal Code', 
                                             'Telephone Area Code', 
                                             'DMA', 'MSA', 'Bandwidth'),
                                report_outlook=c('Statistics', 'Forecast'),
                                id,
                                max_row="100",
                                position=NULL,
                                start_date=NULL,
                                end_date=NULL)

Arguments

credentials

a character string as returned by oas_build_credentials

report_type

a character string either "Site" or "Section" as these are the only types supported for geo inventory reports

report_geo

a character string from the list of options. "Summary" returns an executive summary, while the rest provide a specific geographic breakdown.

report_outlook

a character string specifying the report to be a descriptive view or a forecast. Note that forecasts must have start and end dates greater than the current date, otherwise they will return 0 row data.frames.

id

a character string containing an identifying name for a Site or Section depending on the report_type

max_row

a character integer limiting the number of rows returned. A character is recommended to avoid larger numbers being formatted in scientific notation and not being properly interpreted by the API.

position

a character vector containing position names. Multiple "position" elements can be specified at once, hence a vector is accepted instead of a string

start_date

a character string for inquiring inventory detail report. This field is optional and must be in the yyyy-mm-dd format.

end_date

a character string for inquiring the inventory detail report by given schedule. This field is optional and must be in the yyyy-mm-dd format.

Value

A data.frame of inventory data in the format of the specified report_type and report_name

Note

Search inventory requests are only available if the Search module is enabled on the account

The arguments for position, campaign_id, site_domain, section_id are optional, but helpful in narrowing the focus for the resultset to shorten request and parsing time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
my_credentials <- build_credentials('myaccount', 
                                    'myusername', 
                                    'mypassword')
                                    
site_geo <- oas_geo_inventory(credentials=my_credentials, 
                                  report_type='Site', 
                                  report_geo='State',
                                  report_outlook='Statistics',
                                  id='www.mysite.com',
                                  start_date='2015-09-01', 
                                  end_date='2015-09-30')
                                  
# Note that forecast reports must have start and end dates >= Sys.Date()
otherwise they will return 0 row data.frames                                  
section_geo <- oas_geo_inventory(credentials=my_credentials, 
                                     report_type='Section', 
                                     report_geo='DMA',
                                     report_outlook='Forecast',
                                     id='Books',
                                     max_row="20000",
                                     position=c('Bottom', 'Bottom1'),
                                     start_date='2015-12-01', 
                                     end_date='2015-12-31')
                                     

## End(Not run)

ReportMort/roas documentation built on May 9, 2019, 9:45 a.m.