运行中的 Reporting API

See common and detailed ways clients have used the Reporting API to accomplish their goals.

1500

Batch Exporting Logs

For many TUNE customers, it makes sense to pull log-level data into on a continuing basis, so that a historical copy of data is available for internal analysis. One way to accomplish this is to use the new v3 TUNE Logs API to extract data incrementally on a regular schedule, transforming and loading it into your own system as necessary.

Database developers may recognize this pattern of extraction, transformation, and loading as the classic ETL process.

Ultimately, the way that you implement ETL of TUNE Logs data will be dependent on the specific needs and requirements of your business. That said, as a means of getting you started, we've provided an example Python script in this article that demonstrates one way of doing ETL with TUNE's new v3 Log service—and we've included a few configuration parameters you can tweak to suit your needs (timezone, extraction interval, etc.)

注意事项

  • We limit the exporting of log data to the last 120 days worth of data. For anything older than 120 days, please email [email protected] to request a report pull.
  • As of May 2018, we will have a max retention period of 25 months for all log-level data. Therefore, we highly recommend pulling your log-level data on a regular basis to ensure continuous access to your historical data.
  • This code is provided without warranty or support—it is not a TUNE product, but rather a starting point that any developer can use for writing their own ETL-style script for transferring Logs data from TUNE to your corporate marketing data warehouse.

Download ETL Script & Config File

To start modifying this code to suit your own purposes, the first step is to download the following Python script and configuration file. Then you can set it to run on a scheduled interval to perform batch exports for user-defined time increments and collect your S3 download links.

Finally, you'll need to use your favorite HTTP library to download the data behind the S3 links to transform and load it into your system as appropriate.

❗️

Unavailable

The sample ETL script is no longer available to download.

入门

Update the configuration file

Tailor the script for your organization by updating export_report.json with the following information. Only include the report types that you need (clicks, postbacks, installs, etc):

{
     "advertiser": {
          "id": ADVERTISER_ID,
          "api_key": "API_KEY",
          "timezone": "TIMEZONE_STRING"
     },

     "reports": {
          "installs": {
               "url": "EXPORT_URI",
               "opt_interval_by_hour": HOUR_INTERVAL
          },
          "clicks": {
               "url": "EXPORT_URI",
               "opt_interval_by_hour": HOUR_INTERVAL
          }
    ...
    }
}

ADVERTISER_ID

Integer, your organization's advertiser id

API_KEY

String, your organization's api key

TIMEZONE_STRING

String, following ISO 8601

EXPORT_URI

String, the export call you wish to make. Omit the following parameters: start_date, end_date, limit, and api_key since these fields are filled in by the script. Limit is preset to the maximum number of records, 2 million.

HOUR_INTERVAL

Integer or float representing the time increments you would like to pull data for. If 1 is provided, then exports will be pulled hourly between the start_date and end_date provided. Float values are also accepted, like 0.5 for half-hour increments.

Example JSON File

{
     "advertiser": {
          "id": 0000,
          "api_key": "XXXXXX",
          "timezone": "America/Los_Angeles"
     },

     "reports": {
          "installs": {
               "url": "https://api.mobileapptracking.com/v3/logs/advertisers/0000/exports/installs?api_key=XXXXXX&fields=created",
               "opt_interval_by_hour": 6
          },
          "clicks": {
               "url": "https://api.mobileapptracking.com/v3/logs/advertisers/0000/exports/clicks?api_key=XXXXXX&fields=created",
               "opt_interval_by_hour": 24
          },
          "impressions": {
               "url": "https://api.mobileapptracking.com/v3/logs/advertisers/0000/exports/impressions?api_key=XXXXXX&fields=created"
          },
          "event_items": {
               "url": "https://api.mobileapptracking.com/v3/logs/advertisers/0000/exports/event_items?api_key=XXXXXX&fields=created"
          }
    }
}

Start exports

Once you have customized export_report.json, run the export script from the command line:

$ python export_report_jobs.py new export_report.json "YYYY-MM-DDTHH-MM-SS" "YYYY-MM-DDTHH-MM-SS"

Once the processes are complete, your export links can be found in the export_report.json.jobs file.

Check export status

As the new export process runs, you can check the status of the exports with

$ python export_report_jobs.py status export_report.json "YYYY-MM-DDTHH-MM-SS" "YYYY-MM-DDTHH-MM-SS"

Resume exports

If the new exports process is interrupted, use this command to resume exports:

$ python export_report_jobs.py resume export_report.json "YYYY-MM-DDTHH-MM-SS" "YYYY-MM-DDTHH-MM-SS"

Display all S3 export links

Retrieve all S3 download URLs for exports data

$ python export_report_jobs.py display export_report.json "YYYY-MM-DDTHH-MM-SS" "YYYY-MM-DDTHH-MM-SS"

S3 export download links have an expiration date of two weeks.

Finishing the ETL Process

Remember that TUNE's S3 links have a standard expiration of two weeks, so the script that gets the S3 links should be closely linked with whatever process is responsible for downloading the data and storing it in your system.

Viewing Sample Actuals Request & Response

Learn how to create a service request and view a listing of all available fields including which are recommended for best coverage of results.

Servicing TUNE Reporting API Requests and Responses

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/count.jsonp?
callback=jQuery18303470250559039414_1423157874603
&api_key=YOUR_API_KEY_HERE
&filter=((publisher_id > 0)
  AND ((debug_mode=0 OR debug_mode is NULL)
  AND (test_profile_id=0 OR test_profile_id IS NULL)))
&group=site_id,publisher_id
&start_date=01/29/2015
&end_date=02/05/2015
&response_timezone=America/Los_Angeles
&_=[Cache refresh Timestamp]

JSON Response

jQuery18303470250559039414_1423157874603
(
{
   status_code:200,
   response_size:"52",
   data:3126 << Count
}
)

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/find.jsonp?
callback=jQuery18306392995368223637_1422810089195
&api_key=YOUR_API_KEY_HERE
&page=1
&limit=2
&fields=site_id,site.name,publisher_id,publisher.name,
  ad_clicks_unique,installs,events,payouts,revenues_usd
&sort[installs]=desc
&filter=((publisher_id > 0)
  AND ((debug_mode=0 OR debug_mode is NULL)
  AND (test_profile_id=0 OR test_profile_id IS NULL)))
&group=site_id,publisher_id
&start_date=01/25/2015
&end_date=02/01/2015
&response_timezone=America/Los_Angeles
&_=[Cache refresh Timestamp]

JSON Response

jQuery18306392995368223637_1422810089195(
{
   status_code:200,
   response_size:"516",
   data:[
      {
         site_id:3002,
         publisher_id:46872,
         installs:"64713",
         events:"183",
         payouts:"0.00000",
         ad_clicks_unique:"129919",
         revenues_usd:"0.00000",
         site:{
            name:"Vestibulum faucibus lorem (Google)"
         },
         publisher:{
            name:"Aliquam pellentesque - Curabitur"
         }
      },
      {
         site_id:3002,
         publisher_id:85622,
         installs:"56546",
         events:"5",
         payouts:"0.00000",
         ad_clicks_unique:"144440",
         revenues_usd:"0.00000",
         site:{
            name:"Vestibulum faucibus lorem (Google)"
         },
         publisher:{
            name:"Maecenas fringilla - Vivamus"
         }
      }
   ]
}
)

Export Report: /advertiser/stats/find_export_queue.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/find_export_queue.jsonp?
callback=jQuery18306083544725552201_1423159766900
&api_key=YOUR_API_KEY_HERE
&fields=site_id,site.name,publisher_id,publisher.name,ad_clicks_unique,installs,events,payouts,revenues_usd
&sort[installs]=desc
&filter=((publisher_id > 0) AND ((debug_mode=0 OR debug_mode is NULL) AND (test_profile_id=0 OR test_profile_id IS NULL)))
&group=site_id,publisher_id
&start_date=01/29/2015
&end_date=02/05/2015
&response_timezone=America/Los_Angeles
&format=csv
&_=[Cache refresh Timestamp]

JSON Response

jQuery18306083544725552201_1423159766900(
{
   status_code: 200,
   response_size: "83",
   data: "dummyr7ndr6w43y25reqpfnqu83dummy"  << Job ID of Report on Export Queue
}
)

Export Report Status and Download: /export/download.json

URL Request

https://api.mobileapptracking.com/v2/export/download.jsonp?callback=
jQuery18306083544725552201_1423159766900
&api_key=YOUR_API_KEY_HERE
&job_id=dummyr7ndr6w43y25reqpfnqu83dummy   << Job ID of Report on Export Queue
&_=[Cache refresh Timestamp]

JSON Response

jQuery18306083544725552201_1423159766900(
{
   status_code:200,
   response_size:"408",
   data:{
      status:"complete",      << Status of Report on Export Queue
      percent_complete:100,   << Percent Completion of Report on Export Queue
      data:{
         format:"csv",
                              << Report Download Link when Report Status is "complete"
         url:"https://s3.amazonaws.com/hasfiles/tmp/#######-#######-dummy.csv?response-content-disposition=attachment%3B%20filename%3D%22tmp%2F#######-#######-dummy.csv%22&AWSAccessKeyId=dummy&Expires=1423764571&Signature=QMs%dummy%dummy%3D"
      }
   }
}
)

Mapping Platform Reporting to Record's Fields of Endpoint

This is a complete listing of all available data points, also referred to as the fields, provided by the StatAdvertiser model, which endpoint the TUNE Reporting API's Actuals is bound.

Group By

Label

字段名称

代理商 ID

agency_id

代理商

agency.name

Attribution Method

match_type

Campaign ID

campaign_id

Campaign

campaign.name

Country ID

country_id

Country

country.name

货币

currency_code

Destination URL ID

campaign_url_id

Destination URL

campaign_url.name

Event ID

site_event_id

事件

site_event.name

Integration ID

ad_network_id

集成

ad_network.name

Is Re-Engagement

is_reengagement

Is View-Through

is_view_through

Mobile App ID

site_id

移动应用程序

site.name

Partner ID

publisher_id

伙伴

publisher.name

Purchase Validation Status

purchase_validation_status

Region ID

region_id

Region

region.name

Show

Label

字段名称

Attributed Events

paid_events

归因安装

paid_installs

Campaign Count

campaign_count

Clicks Unique

ad_clicks_unique

Clicks

ad_clicks

Event Assists

paid_events_assists

事件

事件

Impressions Unique

ad_impressions_unique

Impressions(展示)

ad_impressions

Install Assists

paid_installs_assists

Installs

安装次数

Margin

profit

Non-Windowed Event Contributions

non_events_assists

Non-Windowed Install Contributions

non_installs_assists

Open

打开

Organic Installs

organic_installs

Payouts

payouts

Publisher Count

publisher_count

Revenues Local

revenues

Revenues USD

revenues_usd

Updates

更新

Audience

Label

字段名称

Age

age

设备品牌

wurfl_brand_name

设备型号

wurfl_model_name

设备操作系统

wurfl_device_os

设备类型

device_type

性别

gender

OS Jailbroke

os_jailbroke

Test Profile ID

test_profile_id

Test Profile

test_profile.name

伙伴

Label

字段名称

Partner Ad

publisher_sub_ad.name

Partner Ad ID

publisher_sub_ad_id

Partner Ad Group

publisher_sub_adgroup.name

Partner Ad Group ID

publisher_sub_adgroup_id

Partner Campaign

publisher_sub_campaign.name

合作伙伴活动 ID

publisher_sub_campaign_id

Partner Campaign Reference

publisher_sub_campaign.ref

Partner Keyword

publisher_sub_keyword.name

Partner Keyword ID

publisher_sub_keyword_id

Partner Placement

publisher_sub_placement.name

Partner Placement ID

publisher_sub_placement_id

Partner Publisher

publisher_sub_publisher.name

Partner Publisher ID

publisher_sub_publisher_id

Partner Site

publisher_sub_site.name

Partner Site ID

publisher_sub_site_id

Reference ID

publisher_ref_id

Mine

Label

字段名称

My Ad ID

advertiser_sub_ad_id

My Ad

advertiser_sub_ad.name

My Adgroup ID

advertiser_sub_adgroup_id

My Adgroup

advertiser_sub_adgroup.name

My Campaign ID

advertiser_sub_campaign_id

My Campaign Reference

advertiser_sub_campaign.ref

My Campaign

advertiser_sub_campaign.name

My Keyword ID

advertiser_sub_keyword_id

My Keyword

advertiser_sub_keyword.name

My Partner ID

advertiser_sub_publisher_id

My Partner

advertiser_sub_publisher.name

My Placement ID

advertiser_sub_placement_id

My Placement

advertiser_sub_placement.name

My Site ID

advertiser_sub_site_id

My Site

advertiser_sub_site.name

用户 ID

user_id

Viewing Sample Cohort Values (LTV) Request & Response

TUNE Reporting API endpoint Reporting Cohort Values (LTV) section presents how to create a service request and provides a listing of all available fields including which are recommended for best coverage of results.

Servicing TUNE Reporting API Requests and Responses

Count Records in Report: /advertiser/stats/ltv/count.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/count.jsonp?
callback=jQuery18309657427254132926_1423183548739
&api_key=YOUR_API_KEY_HERE
&filter=((publisher_id > 0)
  AND (test_profile_id=0 OR test_profile_id IS NULL))
&timestamp=
&group[]=publisher_id
&start_date=2015-01-29
&end_date=2015-02-05
&response_timezone=America/Los_Angeles
&interval=year_day
&cohort_type=install
&aggregation_type=cumulative
&_=[Cache refresh Timestamp]

JSON Response

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/find.jsonp?
callback=jQuery18306392995368223637_1422810089197
&api_key=YOUR_API_KEY_HERE
&fields[]=publisher_id
&fields[]=publisher.name
&fields[]=rpi
&filter=((publisher_id > 0)
  AND (test_profile_id=0 OR test_profile_id IS NULL))
&sort=rpi desc
&timestamp=
&group[]=publisher_id
&start_date=2015-01-25
&end_date=2015-02-01
&response_timezone=America/Los_Angeles
&page=1
&limit=2
&interval=year_day
&cohort_type=install
&aggregation_type=cumulative
&_=[Cache refresh Timestamp]

JSON Response

jQuery18306392995368223637_1422810089197(
{
   status_code:200,
   response_size:"12493",
   data:[
      {
         data:[
            {
               rpi:0.36
            },
            {
               rpi:0.44
            },
            {
               rpi:0.46
            },
            {
               rpi:0.79
            },
            {
               rpi:0.79
            },
            {
               rpi:0.79
            },
            {
               rpi:0.79
            },
            {
               rpi:0.79
            }
         ],
         meta:{
            publisher_id:####,
            rpi:0.79,
            publisher:{
               name:"####"
            }
         }
      },
      {
         data:[
            {
               rpi:0.19
            },
            {
               rpi:0.31
            },
            {
               rpi:0.46
            },
            {
               rpi:0.48
            },
            {
               rpi:0.48
            },
            {
               rpi:0.48
            },
            {
               rpi:0.48
            },
            {
               rpi:0.48
            }
         ],
         meta:{
            publisher_id:####,
            rpi:0.48,
            publisher:{
               name:"####"
            }
         }
      }
   ]
}
)

Export Report to Queue: /advertiser/stats/ltv/export.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/export.jsonp?
callback=jQuery18306083544725552201_1423159766900
&api_key=YOUR_API_KEY_HERE
&fields[]=publisher_id
&fields[]=publisher.name
&fields[]=rpi
&filter=((publisher_id > 0) AND (test_profile_id=0 OR test_profile_id IS NULL))
&sort=rpi desc
&group[]=publisher_id
&start_date=2015-01-29
&end_date=2015-02-05
&response_timezone=America/Los_Angeles
&interval=year_day
&cohort_type=install
&aggregation_type=cumulative
&format=csv
&_=[Cache refresh Timestamp]

JSON Response

{
   status_code:200,
   response_size:"98",
   data:{
      job_id:"dummyb86-2d47-42d9-b776-d6f7062dummy"
   }
}
)

Report Export Status and Download from Queue: /advertiser/stats/ltv/status.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/status.jsonp?
callback=jQuery18302778368766885251_1423265320859
&api_key=YOUR_API_KEY_HERE
&job_id=dummy149-fa25-4be2-ae55-b599c9ddummy
&_=1423265323044

JSON Response

jQuery18302778368766885251_1423265320859(
{
   status_code:200,
   response_size:"382",
   data:{
      status:"complete",
      percent_complete:100,
      url:"https://s3.amazonaws.com/########/########-####-####-####-########.csv?response-content-disposition=attachment%3B%20filename%3D%########-####-####-####-########.csv%22&AWSAccessKeyId=########&Expires=########&Signature=########%3D"
   }
}
}

Servicing TUNE Reporting API Requests and Responses

This is a complete listing of all available data points, also referred to as the fields, provided by Reporting\Report_Ltv, which endpoint TUNE Reporting API's Cohort Values (LTV) is bounded

Group By

Include at least one of these identifiers in parameter fields, and use one or more for parameter group

Label

字段名称

Attribution Method

match_type

Campaign ID

campaign_id

Campaign

campaign.name

国家代码

country_code

Country

country.name

Destination URL ID

campaign_url_id

Destination URL

campaign_url.name

设备品牌

wurfl_brand_name

设备型号

wurfl_model_name

设备操作系统

wurfl_device_os

设备类型

device_type

Event ID

site_event_id

事件

site_event.name

Is View-Through

is_view_through

Mobile App ID

site_id

移动应用程序

site.name

My Ad

advertiser_sub_ad

My Adgroup

advertiser_sub_adgroup

My Campaign Reference

advertiser_sub_campaign.ref

My Campaign

advertiser_sub_campaign

My Keyword

advertiser_sub_keyword

My Placement

advertiser_sub_placement

My Site

advertiser_sub_site

OS Jailbroke

os_jailbroke

Partner Ad Group

publisher_sub_adgroup

Partner Ad

publisher_sub_ad

Partner Campaign

publisher_sub_campaign

Partner ID

publisher_id

Partner Keyword

publisher_sub_keyword

Partner Placement

publisher_sub_placement

Partner Publisher

publisher_sub_publisher

Partner Site

publisher_sub_site

伙伴

publisher.name

Purchase Validation Status

purchase_validation_status

Region Code

region_code

Region

region.name

Test Profile ID

test_profile_id

Test Profile

test_profile.name

Show

Label

字段名称

1st Purchase

purchase_1st

2nd Opens

open_2nd

2nd Purchase

purchase_2nd

Average Time To 1st Purchase

purchase_1st_avg_sec

Average Time To 2nd Open

open_2nd_avg_sec

Average Time To 2nd Purchase

purchase_2nd_avg_sec

事件

事件

Installs

安装次数

Open

打开

Payouts

payouts

Purchase

purchases

Revenues USD

revenues_usd

Calculate

Label

字段名称

% To Paycheck

payback

CPI

cpi

EPI

epi

OPI

opi

RPI

rpi

Viewing Sample Retention Request & Response

TUNE Reporting API endpoint Reporting Cohort Retention section presents how to create a service request and provides a listing of all available fields including which are recommended for best coverage of results.

Mapping Platform Reporting to API Fields

For a complete listing of all available data points, also referred to as fields, reference the Reporting/Report_Retention data model.

Example TUNE Reporting API Requests and Responses

Count Records: /advertiser/stats/retention/count.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/retention/count.json?
&group[0]=install_publisher_id
&filter=
&response_timezone=America/Los_Angeles
&start_date=01/29/2015
&end_date=02/05/2015
&interval=year_day
&cohort_type=install
&api_key=YOUR_API_KEY_HERE

JSON Response

{
   status_code:200,
   response_size:"51",
   data:699   << Record Count
}
Stream Report: /advertiser/stats/retention/find.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/retention/find.json?
fields=installs,opens,install_publisher_id,install_publisher.name
&group[0]=install_publisher_id
&filter=
&response_timezone=America/Los_Angeles
&start_date=01/24/2015
&end_date=01/31/2015
&interval=year_day
&cohort_type=install
&page=1
&limit=20
&sort[year_day]=asc
&api_key=YOUR_API_KEY_HERE

JSON Response

{
  status_code:200,
   response_size:"846",
   data:[
      {
         data:[
            {
               installs:15380,
               opens:5668
            },
            {
               installs:0,
               opens:664
            },
            {
               installs:0,
               opens:1178
            },
            {
               installs:0,
               opens:822
            },
            {
               installs:0,
               opens:753
            },
            {
               installs:0,
               opens:701
            },
            {
               installs:0,
               opens:707
            },
            {
               installs:0,
               opens:566
            },
            {
               installs:0,
               opens:150
            }
         ],
         meta:{
            install_publisher_id:####,
            installs:15380,
            opens:11209,
            year_day:"2015_024",
            install_publisher:{
               name:"Nam vel metus id dolor"
            }
         }
      },
      {
         data:[
            {
               installs:1370,
               opens:767
            },
            {
               installs:0,
               opens:100
            },
            {
               installs:0,
               opens:200
            },
            {
               installs:0,
               opens:136
            },
            {
               installs:0,
               opens:136
            },
            {
               installs:0,
               opens:146
            },
            {
               installs:0,
               opens:116
            },
            {
               installs:0,
               opens:99
            },
            {
               installs:0,
               opens:21
            }
         ],
         meta:{
            install_publisher_id:####,
            installs:1370,
            opens:1721,
            year_day:"2015_024",
            install_publisher:{
               name:"Phasellus et lorem non nulla"
            }
         }
      }
   ]
 }
Export Report to Queue: /advertiser/stats/retention/export.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/retention/export.json?
fields=installs,opens,install_publisher_id,install_publisher.name
&group[0]=install_publisher_id
&filter=
&response_timezone=America/Los_Angeles
&start_date=01/29/2015
&end_date=02/05/2015
&interval=year_day
&cohort_type=install
&sort[year_day]=asc
&api_key=YOUR_API_KEY_HERE

JSON Response

{
   status_code:200,
   response_size:"98",
   data:{
      job_id:"dummy####-####-####-####-####dummy" << Job Id of Report in Export Queue
   }
}
Report Export Status and Download from Queue: /advertiser/stats/retention/status.json

URL Request

https://api.mobileapptracking.com/v2/advertiser/stats/retention/status.json?
job_id=dumm####-####-####-####-####dummy << Job Id of Report in Export Queue

JSON Response

{
   status_code:200,
   response_size:"388",
   data:{
      status:"complete",
      percent_complete:100,               << Report Download Link from AWS S3
      url:"https://s3.amazonaws.com/########/#########-####-####-####-#########.csv?response-content-disposition=attachment%3B%20filename%3D%22#########-####-####-####-#########.csv%22 &AWSAccessKeyId=######### &Expires=#########&Signature=#########%2B####%2F####%2B####%3D"
   }
}

The Retention report provided in the TUNE platform automatically excludes testing and debugging data (installs, opens, and events associated with debugging requests or test profiles). This exclusion prevents test data from skewing the retention calculation.

If you are using our Reporting API to export retention results, filter out where debug_mode is greater than 0 or test_profile_id is greater than 0. For example, the following filter for including only real data and excluding test data can be applied on a request for the "*Find*" endpoint of Retention:

&filter=(test_profile_id = 0 and debug_mode = 0)

Viewing Sample Update to LTV Reports Request & Response

Update

TUNE has deployed a new system for LTV reports. This new system is several times faster and far more accurate than the previous system.

Currently, the database for the old system is not being consistently updated. Using the new endpoint is a matter of converting the old queries to the new.

Previously, there were two endpoints: one for click reports and another for install reports:

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/click/find.json
https://api.mobileapptracking.com/v2/advertiser/stats/ltv/install/find.json

Now there is a single endpoint for both click reports and install reports:

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/find.json

Parameter Changes

Nearly all the parameters used with the old endpoint will work with the new with these minor changes:

New LTV Report Parameters

参数名称

参数类型

Parameter Values

cohort_type

String New parameter

'click' 'install'

interval

String New values for the cohort 'interval' parameter.

'day' is now'year_day' 'week' is now'year_week' 'month' is now'year_month' 'year' remains'year'

aggregation_type

String, Renamed parameter: 'cohort_values' is now 'aggregation_type'

'cumulative' 'incremental'

Endpoint Example

The transformation for this old endpoint:

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/install/find.json?
&fields%5B%5D=publisher_id
&fields%5B%5D=rpi
&fields%5B%5D=currency_code
&filter=((site_id+%3D+'532')+AND+(test_profile_id%3D0+OR+test_profile_id+IS+NULL))
&sort=rpi+desc
&group%5B%5D=publisher_id
&start_date=2014-08-01
&end_date=2014-08-31
&response_timezone=America%2FLos_Angeles
&interval=day
&cohort_type=install
&cohort_values=cumulative
&api_key=YOUR_API_KEY_HERE

Renders this new query:

https://api.mobileapptracking.com/v2/advertiser/stats/ltv/find.json?
&fields%5B%5D=publisher_id
&fields%5B%5D=rpi
&fields%5B%5D=currency_code
&filter=((site_id+%3D+'532')+AND+(test_profile_id%3D0+OR+test_profile_id+IS+NULL))
&sort=rpi+desc
&group%5B%5D=publisher_id
&start_date=2014-08-01
&end_date=2014-08-31
&response_timezone=America%2FLos_Angeles
&interval=year_day
&cohort_type=install
&aggregation_type=cumulative
&api_key=YOUR_API_KEY_HERE

Example Output

The output for the call has also been adjusted to be more sensible. Rather than separating aggregate values into their own interval lists, single interval list per grouping contains all aggregates in each interval. Non-aggregate fields are now contained in a single meta object that comes after the interval list.

An example of old output:

{
  status_code: 200,
  response_size: "26012",
  data: [
      {
        site_id: 35852,
        publisher_id: 21384,
        test_profile_id: 0,
        cpi: "1.000000000",
        rpi: "1.972901769",
        currency_code: "USD",
        site: {
          name: "MAT Android App"
        },
        publisher: {
          name: "MAT Publisher"
        },
        cpi_interval: {
          1: {
            interval: "1",
            value: "1.000000000"
          },
          2: {
            interval: "2",
            value: "2.000000000"
          },
          ... more intervals ...
        }
        rpi_interval: {
          1: {
            interval: "1",
            value: "0.010000000"
          },
          2: {
            interval: "2",
            value: "0.340000000"
          },
            ... more intervals ...
      }
    }
  ]
}
```

Compared to the new:

```json
{
  status_code: 200,
  response_size: "6031",
  data: [
    {
      data: [
        {
          cpi: 1.00,
          rpi: 0.01
        },
        {
          cpi: 2.00,
          rpi: 0.34
        },
      ... more intervals ...
      meta: {
        cpi: 1.00,
        currency_code: "USD",
        publisher_id: 21384,
        rpi: 1.97,
        site_id: 35852,
        publisher: {
          name: "MAT Publisher"
        },
        site: {
          name: "MAT Android App"
        }
      }
    ]
  }
]
}

API 参考

/advertiser/stats/ltv/find.json