필터

Reporting API in Action

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.

Getting Started

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_IDInteger, your organization's advertiser id
API_KEYString, your organization's api key
TIMEZONE_STRINGString, following ISO 8601
EXPORT_URIString, 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_INTERVALInteger 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

LabelField Name
Agency IDagency_id
에이전시agency.name
Attribution Methodmatch_type
캠페인 IDcampaign_id
Campaigncampaign.name
Country IDcountry_id
Countrycountry.name
Currencycurrency_code
Destination URL IDcampaign_url_id
Destination URLcampaign_url.name
Event IDsite_event_id
이벤트site_event.name
Integration IDad_network_id
Integrationad_network.name
Is Re-Engagementis_reengagement
Is View-Throughis_view_through
Mobile App IDsite_id
Mobile Appsite.name
Partner IDpublisher_id
파트너publisher.name
Purchase Validation Statuspurchase_validation_status
Region IDregion_id
Regionregion.name

Show

LabelField Name
Attributed Eventspaid_events
어트리뷰션 된 설치paid_installs
Campaign Countcampaign_count
Clicks Uniquead_clicks_unique
Clickad_clicks
Event Assistspaid_events_assists
Events이벤트
Impressions Uniquead_impressions_unique
Impressionsad_impressions
Install Assistspaid_installs_assists
Install설치
Marginprofit
Non-Windowed Event Contributionsnon_events_assists
Non-Windowed Install Contributionsnon_installs_assists
Open오픈 수
Organic Installsorganic_installs
Payoutspayouts
Publisher Countpublisher_count
Revenues Localrevenues
Revenues USDrevenues_usd
Updatesupdates

Audience

LabelField Name
Ageage
Device Brandwurfl_brand_name
Device Modelwurfl_model_name
Device OSwurfl_device_os
Device Typedevice_type
Gendergender
OS Jailbrokeos_jailbroke
Test Profile IDtest_profile_id
Test Profiletest_profile.name

파트너

LabelField Name
Partner Adpublisher_sub_ad.name
Partner Ad IDpublisher_sub_ad_id
Partner Ad Grouppublisher_sub_adgroup.name
Partner Ad Group IDpublisher_sub_adgroup_id
Partner Campaignpublisher_sub_campaign.name
파트너 캠페인 IDpublisher_sub_campaign_id
Partner Campaign Referencepublisher_sub_campaign.ref
Partner Keywordpublisher_sub_keyword.name
Partner Keyword IDpublisher_sub_keyword_id
Partner Placementpublisher_sub_placement.name
Partner Placement IDpublisher_sub_placement_id
Partner Publisherpublisher_sub_publisher.name
Partner Publisher IDpublisher_sub_publisher_id
Partner Sitepublisher_sub_site.name
Partner Site IDpublisher_sub_site_id
Reference IDpublisher_ref_id

Mine

LabelField Name
My Ad IDadvertiser_sub_ad_id
My Adadvertiser_sub_ad.name
My Adgroup IDadvertiser_sub_adgroup_id
My Adgroupadvertiser_sub_adgroup.name
My Campaign IDadvertiser_sub_campaign_id
My Campaign Referenceadvertiser_sub_campaign.ref
My Campaignadvertiser_sub_campaign.name
My Keyword IDadvertiser_sub_keyword_id
My Keywordadvertiser_sub_keyword.name
My Partner IDadvertiser_sub_publisher_id
My Partneradvertiser_sub_publisher.name
My Placement IDadvertiser_sub_placement_id
My Placementadvertiser_sub_placement.name
My Site IDadvertiser_sub_site_id
My Siteadvertiser_sub_site.name
User IDuser_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.

LabelField Name
Attribution Methodmatch_type
캠페인 IDcampaign_id
Campaigncampaign.name
Country Codecountry_code
Countrycountry.name
Destination URL IDcampaign_url_id
Destination URLcampaign_url.name
Device Brandwurfl_brand_name
Device Modelwurfl_model_name
Device OSwurfl_device_os
Device Typedevice_type
Event IDsite_event_id
이벤트site_event.name
Is View-Throughis_view_through
Mobile App IDsite_id
Mobile Appsite.name
My Adadvertiser_sub_ad
My Adgroupadvertiser_sub_adgroup
My Campaign Referenceadvertiser_sub_campaign.ref
My Campaignadvertiser_sub_campaign
My Keywordadvertiser_sub_keyword
My Placementadvertiser_sub_placement
My Siteadvertiser_sub_site
OS Jailbrokeos_jailbroke
Partner Ad Grouppublisher_sub_adgroup
Partner Adpublisher_sub_ad
Partner Campaignpublisher_sub_campaign
Partner IDpublisher_id
Partner Keywordpublisher_sub_keyword
Partner Placementpublisher_sub_placement
Partner Publisherpublisher_sub_publisher
Partner Sitepublisher_sub_site
파트너publisher.name
Purchase Validation Statuspurchase_validation_status
Region Coderegion_code
Regionregion.name
Test Profile IDtest_profile_id
Test Profiletest_profile.name

Show

LabelField Name
1st Purchasepurchase_1st
2nd Opensopen_2nd
2nd Purchasepurchase_2nd
Average Time To 1st Purchasepurchase_1st_avg_sec
Average Time To 2nd Openopen_2nd_avg_sec
Average Time To 2nd Purchasepurchase_2nd_avg_sec
Events이벤트
Install설치
Open오픈 수
Payoutspayouts
Purchasepurchases
Revenues USDrevenues_usd

Calculate

LabelField Name
% To Paycheckpayback
CPIcpi
EPIepi
OPIopi
RPIrpi

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_typeString New parameter'click' 'install'
intervalString 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_typeString, 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