Reports\uf0c1

Individual Push Response Stats\uf0c1

Returns detailed report information about a specific push notification. Use the push_id, which is the identifier returned by the API that represents a specific push message delivery. For more information, see the API documentation on individual push statistics

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
d = UA::IndividualResponseStats.new(client: airship)
statistics = d.get(push_id: 'push_id')

Devices Report\uf0c1

Returns an app’s opted-in and installed device counts broken out by device type. This endpoint returns the same data that populates the Devices Report. For more information, see the API documentation on device reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
d = UA::DevicesReport.new(client: airship)
devices = d.get(date: '2015/08/01')

Push Report\uf0c1

Get the number of pushes you have sent within a specified time period. For more information, see the API documentation on push reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::PushList.new(
    client: airship,
    start_date: '2015/06/01',
    end_date: '2015/08/01',
    precision: 'HOURLY'
)
listing.each do |resp|
    puts(resp)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]

Response Report\uf0c1

Get the number of direct and influenced opens of your app. For more information, see the API documentation on reponse reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::ResponseReportList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    precision: 'MONTHLY'
)
listing.each do |resp|
    puts(resp)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]

Response Listing\uf0c1

Get a listing of all pushes and basic response information in a given timeframe by instantiating an iterator object using ResponseList. Start and end date times are required parameters. For more information, see the API documentation on response listings

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
response_list = UA::ResponseList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    limit: 20,
    push_id_start: 'start_id'
)
response_list.each do |resp|
    puts(resp)
end

Note

limit (optional) is the number of results desired per page. push_id_start (optional) specifies the id of the first response to return.

App Opens Report\uf0c1

Get the number of users who have opened your app within the specified time period. For more information, see the API documentation on app open reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::AppOpensList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    precision: 'HOURLY')
listing.each do |app_opens|
    puts(app_opens)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]

Time In App Report\uf0c1

Get the average amount of time users have spent in your app within the specified time period. For more information, see the API documentation on time-in-app reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::TimeInAppList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    precision: 'HOURLY')
listing.each do |time_in_app|
    puts(time_in_app)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]

Opt-In Report\uf0c1

Get the number of opted-in push users who access the app within the specified time period. For more information, see the API documentation on opt-in reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::OptInList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    precision: 'HOURLY')
listing.each do |opt_ins|
    puts(opt_ins)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]

Opt-Out Report\uf0c1

Get the number of opted-out push users who access the app within the specified time period. For more information, see the API documentation on opt-out reports

require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
listing = UA::OptOutList.new(
    client: airship,
    start_date: '2015-06-01',
    end_date: '2015-08-01',
    precision: 'HOURLY')
listing.each do |opt_outs|
    puts(opt_outs)
end

Note

precision needs to be a member of [‘HOURLY’, ‘DAILY’, ‘MONTHLY’]