Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tune-reporting

TUNE Reporting SDK for Node.js

tune, reporting, tune reporting, tune management api, management, api

readme

tune-reporting

TUNE Reporting SDK for Node

Incorporate TUNE Reporting services.

Update: $Date: 2015-08-26 17:15:38 $

Version: 1.0.11

===

Table of Contents

Return to Top

Overview

The TUNE Reporting SDKs addressed in this posting are for creating hosted applications which require handling requests to TUNE Advertiser Report services with utility focus is upon Advertiser Reporting endpoints.

Even though the the breadth of the Service goes beyond just reports, it is these reporting endpoints that our customers primarily access.

The second goal of the SDKs is to assure that our customers’ developers are using best practices in gathering reports in the most optimal way.

Available TUNE Reporting SDKs

Supported programming languages for TUNE Reporting SDKs are:

TUNE SDKs for Mobile Apps

The TUNE Reporting SDKs should absolutely not be included within Mobile Apps.

All information pertaining to TUNE SDKs for Mobile Apps are found here.

Developers Community

Developers Community Site for MobileAppTracking™ (MAT), the industry leader in mobile advertising attribution and analytics, provides TUNE Reporting API documentation to best practices and everything you need to be successful with MAT.

This site contains complete information about TUNE Reporting API, and references to all available TUNE Reporting SDKs with sample code.

Return to Top

SDK Installation

This section detail what is required to use this SDK and how to install it for usage.

Installation Prerequisites

Environment

These are the basic requirements to use this SDK:

* node >= 0.10.*
* npm >= 1.4.*

Generate API Key

To use SDK to access Advertiser Reporting endpoints of TUNE Advertiser Report, it requires a MobileAppTracking API Key: Generate API Key.

Installation Choices

You can install tune-reporting-node via npm or by downloading the source from github.

Via npm:

It is available on npm: tune-reporting

Install as follows

    $ npm install tune-reporting

Via ZIP file:

Click here to download the source code (.zip) for tune-reporting.

    $ git clone git@github.com:MobileAppTracking/tune-reporting-node
    $ cd tune-reporting-node
    $ npm install .

TUNE Reporting SDK Configuration

SDK Configuration file

The TUNE Reporting SDK configuration is set within file ./config.js.

And the appropriate environment settings:

config
├── development.json
├── production.json
└── test.json

With generated API_KEY from TUNE MobileAppTracking Platform account, replace UNDEFINED.

; TUNE MobileAppTracking Platform generated API Key. Replace UNDEFINED.
tune.reporting.auth_key=UNDEFINED
; TUNE Reporting Authentication Type: api_key OR session_token.
tune.reporting.auth_type=api_key
; Validate use TUNE Service fields used within action parameters.
tune.reporting.verify_fields_boolean=false
; TUNE reporting export status sleep (seconds).
tune.reporting.status.sleep=10
; TUNE reporting export fetch timeout (seconds).
tune.reporting.status.timeout=240
; TUNE reporting export fetch verbose output.
tune.reporting.status.verbose=false
SDK Configuration module

The TUNE Reporting SDK reads configuration through module ./config.js with the current environment SDK configuration file.

  var
    authKey = config.get('tune.reporting.auth_key'),
    authType = config.get('tune.reporting.auth_type');

By default, configuration is assumed using api_key authentication type.

To override 'api_key' authentication type:

    config.set('tune.reporting.auth_key', apiKey);
    config.set('tune.reporting.auth_type', 'api_key');

To override authentication type using session_token:

    config.set('tune.reporting.auth_key', sessionToken);
    config.set('tune.reporting.auth_type', 'session_token');

If you wish to generate your own session_token, class SessionAuthentication is provided:

  var
    apiKey = config.get('tune.reporting.auth_key'),
    sessionAuthenticate = new SessionAuthenticate();

    sessionAuthenticate.getSessionToken(apiKey, function (error, response) {
      if (error) {
        return next(error);
      }

      console.log(' Status: "success"');
      sessionToken = response.getData();
      console.log(' session_token:');
      console.log(sessionToken);
      return next();
    });

and you're good to go!

Return to Top

SDK Generated Documentation

SDK code is well commented and to see full documentation of its source using the provided Makefile commands that initiate code documentation generators.

Node.jsdoc

The following will generate YUIdoc from Node.js codebase:

This code documentation generation may require npm installation of YUIdoc.

    $ make docs-yuidoc

<figure id="attachment_17743" class="thumbnail wp-caption aligncenter" style="width: 600px">TUNE Reporting SDK YuiDoc Generated<figcaption class="caption wp-caption-text">

TUNE Reporting SDK YuiDoc Generated

</figcaption></figure>

 

### Advertiser Reporting Overview

The utility focus of the SDKs is upon the Advertiser Reporting API endpoints. Even though the the breadth of the Management API goes beyond just reports, it is these endpoints that our customers primarily access. The second goal of the SDKs is to assure that our customers' developers are using best practices in gathering reports in the most optimal way.

<figure style="width: 600px">TUNE Reporting SDK Classes<figcaption class="caption wp-caption-text">TUNE Reporting SDK Classes</figcaption></figure>

The endpoints interfaced by TUNE API SDKs provide access in gathering four types of reports:

Log Reports
Log reports provide measurement records for each Click, Install, Event, Event Item and Postback. Instead of being aggregated, the data is on a per transaction / request basis. MobileAppTracking™ (MAT) uses these logs to generate the aggregated data for the Actuals and Cohort reports. Note that we don’t provide Log reports for Impressions and Opens currently.

Advertiser Reporting classes that perform Log Reports are:

Actuals Report
The Actuals report gives you quick insight into the performance of your apps and advertising partners (publishers). Use this report for reconciliation, testing, debugging, and ensuring that all measurement and attribution continues to operate smoothly. MAT generates this report by aggregating all the logs of each request (MAT updates the report every 5 minutes).

Actuals report endpoint include: /advertiser/stats/: Reports' class AdvertiserReportActuals

Advertiser Reporting class that perform Actuals Reports is:

Cohort Report
The Cohort report analyzes user behavior back to click date time (Cohort by Click) or to install date time (Cohort by Install). Depending on whether you view the results based on click or install, the data in the report is vastly different.

Advertiser Reporting class that perform Cohort Reports is:

Retention Report
The Retention report shows you how many of your installed users open or engage with your app over time (how users continue to get value from the app). AdvertiserReportCohortRetention reports are particularly good for evaluating the quality of users as opposed to the quantity of users (as in the case of user acquisition campaigns). For more information about retention reports, please visit Running AdvertiserReportCohortRetention Reports.

Advertiser Reporting class that perform Retention Reports are:

<figure id="attachment_17769" class="thumbnail wp-caption aligncenter" style="width: 600px">TUNE Reporting API Endpoints<figcaption class="caption wp-caption-text">

TUNE Reporting API Endpoints

</figcaption></figure>

Return to Top

Exporting Advertiser Reports

Currently, there are two different ways of handling advertiser report exports. Both approaches require (A) an action to request that a report be exported and (B) another action to request the report status (if ready to be exported), and if ready, then provide a URL to download the completed report.

Logs and Actuals reports all request an export using action find_export_queue.json, which returns a job_id. You then pass the job_id onto another endpoint Export::download.json, which performs the status checking and report URL retrieval.

Cohort and AdvertiserReportCohortRetention reports all request an export using action export.json, which also returns a job_id. You then pass the job_id onto another action status.json, which performs the status checking and report URL retrieval.

Return to Top

License

MIT License

Reporting Issues

Report issues using the Github Issue Tracker or Email sdk@tune.com.

changelog

tune-reporting Change Log

TUNE Reporting SDK for Node.js

Incorporate TUNE Reporting services.

Update: $Date: 2015-08-26 17:15:38 $

=======================

Here you can see the full list of changes between each tune-api-php release.

Version 0.1.0

Internal Beta release on December 12, 2014

  • Tune Management API Client for Node.js 0.10.*

Version 0.1.6

Beta release on December 18, 2014

  • Fixes to Error Handling.
  • Cleanup in Examples.

Version 0.1.7

Beta release on December 19, 2014

  • Fix to validate filter.
  • JSDoc+Docstrap make.

Version 0.1.8

Beta release on December 22, 2014

  • Refactor /advertiser/stats/ltv as Cohort Value reporting.
  • Refactor /advertiser/stats/retention as Cohort Retention reporting.
  • Refactor all Advertiser Report Logs to be labeled with Logs.

Version 0.1.9

Beta release on December 22, 2014

  • Fixes to Filter building.
  • Refactor all Advertiser Report Logs to be labeled with Logs.

Version 0.1.10

Beta release on December 23, 2014

  • Callbacks instead of expecting Events.
  • Provided .toJson for responses.

Version 0.1.11

Beta release on December 23, 2014

  • Dockerfile for Jenkins CI.

Version 0.1.12

Beta public release on December 24, 2014

  • Refactor Log and Cohort classes
  • TUNE Management API request contains SDK type and version.

Version 0.1.13

Beta public release on December 30, 2014

  • TUNE Management API request contains 'sdk' and 'ver'.

Version 0.1.14

Beta public release on January 02, 2015

  • Configuration files.

Version 0.1.15

Beta public release on January 02, 2015

  • Keywords.

Version 0.1.16

Beta public release on January 02, 2015

  • Accidentally removed examples.

Version 0.1.17

Beta public release on January 05, 2015

  • to JSON

Version 0.1.17

Beta public release on January 05, 2015

  • to JSON

Version 0.1.18

Beta public release on January 06, 2015

  • SDK Authentication: TUNE MobileAppTracking API Key and Session Token.
  • SessionAuthenticate.

Version 0.1.19

Beta public release on January 07, 2015

  • Fixed examples and tests.
  • Replace using module 'request' with native 'https'.
  • Replace using module 'underscore' with 'lodash'.

Version 0.1.20

Beta public release on January 08, 2015

Version 1.0.2

First production release on April 09, 2015

Version 1.0.10

JSON is no longer supported as export file format. Only CSV.

Version 1.0.11

npm documentation cleanup.