PHPackages                             f-dg/kochava-api-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. f-dg/kochava-api-sdk

ActiveLibrary[API Development](/categories/api)

f-dg/kochava-api-sdk
====================

PHP SDK for Kochava API

v0.1(8y ago)022PHPPHP &gt;=5.5.9

Since Dec 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/f-dg/kochava-api-sdk)[ Packagist](https://packagist.org/packages/f-dg/kochava-api-sdk)[ RSS](/packages/f-dg-kochava-api-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

Kochava's web api documentations
================================

[](#kochavas-web-api-documentations)

[Official doc](https://support.kochava.com/analytics-reports-api/api-v1-3-requesting-and-scheduling-reports)

Description
===========

[](#description)

This SDK not fully implemented according to the official doc Feel free to add a new code to the SDK, but do not forget about unit tests

By default a report use:

- `delivery_format` as JSON", "CSV" not implemented
- a timezone is UTC

Obtaining reports are based on queues, this means several request to the api:

1. First call - add request to the queue of report
2. Next calls are pinging to obtain a report status, default frequency is 10 sec
3. Last call - get the report

if pass a long period, preparing the perort can takes a long time of script execution

Installation
============

[](#installation)

```
composer require f-dg/kochava-api-sdk:dev-master
```

or via composer.json

```
  "require": {
    "f-dg/kochava-api-sdk": "dev-master"
  },
```

or via git clone

```
git clone git@github.com:f-dg/kochava-api-sdk.git
```

Example of fetching list of applications
========================================

[](#example-of-fetching-list-of-applications)

```
use \KochavaReporting\ReportSummary,
    \KochavaReporting\ReportSummaryValues,
    \KochavaReporting\CurlAdapter;

/**
 *  you can use either "ReportSummary" or "ReportDetail"
 *  to get list of applications, it doesn't metter
 */
$kochavaSDK = new ReportSummary(new CurlAdapter(), $token);

/**
 *   array(2) {
 *       [0] => array(6) {
 *           'status' => "OK",
 *           'guid' => "app-ios-test-xpv",
 *           'app_name' => "App - iOS Dev",
 *           'app_id' => "19897",
 *           'account_name' => "Country Financial",
 *           'platform' => "ios",
 *       }
 *       [1] => array(6) {
 *           'status' => "OK",
 *           'guid' => "app-android-dev-2zrzfk3",
 *           'app_name' => "App - Android Dev",
 *           'app_id' => "20254",
 *           'account_name' => "Country Financial",
 *           'platform' => "android",
 *       }
 *   }
 */
$apps = $kochavaSDK->getApplications();
```

Example of fetching a Summary Report
====================================

[](#example-of-fetching-a-summary-report)

```
use \KochavaReporting\ReportSummary,
    \KochavaReporting\ReportSummaryValues,
    \KochavaReporting\CurlAdapter;

    $reportSDK = new ReportSummary(
        new CurlAdapter(),
        $kochavaToken,
        $kochavaAppGUID // received from "getApplication" - "app-android-dev-2zrzfk3"
    );

    $period = [
        'from' => '1497819600',
        'to' => '1497906000'
    ];

    /**
     *  Traffic type and counters needed on which to report.
     */
    $traffic = ReportSummaryValues::getTrafficList();

    try {

        /**
         * structure of call
         * check a column "Valid in Report" is supported for "Summary"
         * https://support.kochava.com/analytics-reports-api/api-v1-3-call-structure
         */
        $requestedParams = [
            ReportSummaryValues::FIELD_TIME_START         => $period['from'],
            ReportSummaryValues::FIELD_TIME_END           => $period['to'],
            ReportSummaryValues::FIELD_CUSTOM_REPORT_NAME => reset($traffic),
            ReportSummaryValues::FIELD_TRAFFIC            => $traffic,
            ReportSummaryValues::FIELD_TRAFFIC_FILTERING  => [
                ReportSummaryValues::FIELD_TRAFFIC_FILTERING_NETWORK => [
                    ReportSummaryValues::FACEBOOK_NETRWORK_ID,
                ],
            ],
            /**
             *  FIELD_TIME_SIRIES is grouping period
             *  1=1 hour, 4=4 hour, blocks (12-16, 16-20, 20-24)
             *  if 24, group by day
             */
            ReportSummaryValues::FIELD_TIME_SIRIES        => '1',
            ReportSummaryValues::FIELD_TRAFFIC_GROUPING   => [
                ReportSummaryValues::TRAFFIC_GROUPING_NETWORK,
                ReportSummaryValues::TRAFFIC_GROUPING_CAMPAIGN,
                ReportSummaryValues::TRAFFIC_GROUPING_TRACKER,
            ],
        ];

        $report = $reportSDK->getReport($requestedParams);

    } catch (\Exception $e) {
        echo 'Api response: '.$e->getMessage().PHP_EOL;
    }
```

Example of fetching a Detail Report
===================================

[](#example-of-fetching-a-detail-report)

```
use \KochavaReporting\ReportDetail,
    \KochavaReporting\ReportDetailValues,
    \KochavaReporting\CurlAdapter;

    $reportSDK = new ReportDetail(
        new CurlAdapter(),
        $kochavaToken,
        $kochavaAppGUID // received from "getApplication" - "app-android-dev-2zrzfk3"
    );

    $period = [
        'from' => '1497819600',
        'to' => '1497906000'
    ];

    /**
     *  Traffic type and counters needed on which to report.
     */
    $traffic = ReportDetailValues::getTrafficList();

    $errors = [];
    $statstics = [];

    /**
     *  per request, for Detail Report you can pass to the FIELD_TRAFFIC
     *  only an array with one traffic
     *  that's why used "foreach" to iterate $traffic
     */
    foreach ($traffic as $trafficValue) {

        try {

            /**
             * structure of call
             * check a column "Valid in Report" is supported for "Detail"
             * https://support.kochava.com/analytics-reports-api/api-v1-3-call-structure
             */
            $requestedParams = [
                ReportDetailValues::FIELD_TIME_START         => $period['from'],
                ReportDetailValues::FIELD_TIME_END           => $period['to'],
                ReportDetailValues::FIELD_CUSTOM_REPORT_NAME => $trafficValue,
                ReportDetailValues::FIELD_TRAFFIC            => [
                    $trafficValue
                ],
                ReportDetailValues::FIELD_TRAFFIC_FILTERING  => [
                    ReportDetailValues::FIELD_TRAFFIC_FILTERING_NETWORK => [
                        ReportDetailValues::FACEBOOK_NETRWORK_ID,
                    ],
                ],
            ];

            $statistics[$trafficValue] = $reportSDK->getReport($requestedParams);

        } catch (\Exception $e) {
            $errors[$trafficValue] = $e->getMessage().PHP_EOL;
        }

    }
```

Unit tests
----------

[](#unit-tests)

```
cd path/to/kochava-api-sdk/test && phpunit -v -c ../phpunit.xml . --coverage-text
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3109d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/438539?v=4)[Fabrizio Di Giuseppe](/maintainers/fdg)[@fdg](https://github.com/fdg)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/f-dg-kochava-api-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/f-dg-kochava-api-sdk/health.svg)](https://phpackages.com/packages/f-dg-kochava-api-sdk)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
