freyo / mta-h5
PHP SDK for Mobile Tencent Analytics HTML5
1.0
2019-04-21 13:55 UTC
Requires
- php: >=5.6
- ext-json: *
- guzzlehttp/guzzle: ~6.0
- monolog/monolog: ~1.22
- pimple/pimple: ^3.0
- symfony/http-foundation: ^4.1
Requires (Dev)
- mockery/mockery: 1.0.x-dev
- phpunit/phpunit: ^6.2
This package is auto-updated.
Last update: 2024-11-29 05:29:17 UTC
README
PHP SDK for Mobile Tencent Analytics HTML5
Installation
composer require freyo/mta-h5
Bootstrap
<?php use Freyo\MtaH5\Application; include __DIR__ . '/vendor/autoload.php'; $config = [ 'app_id' => 'your-app-id', 'secret_key' => 'your-secret-key', ]; $app = new Application($config);
API
$app->trend->query($startDate, $endDate); $app->trend->realtime(); $app->trend->heartbeat(); $app->user->realtime($page = 1); $app->user->compare($startDate, $endDate); $app->user->portrait($startDate, $endDate); $app->device->query($startDate, $endDate, $typeId, $typeContents = []); $app->device->operator($startDate, $endDate, $typeIds); $app->device->area($startDate, $endDate, $typeIds); $app->device->province($startDate, $endDate, $typeIds); $app->page->realtime(); $app->page->offline($startDate, $endDate, $page = 1); $app->page->query($startDate, $endDate, $urls); $app->page->depth($startDate, $endDate); $app->page->speed($startDate, $endDate, $typeContents, $type); $app->custom->query($startDate, $endDate, $custom); $app->source->query($startDate, $endDate, $urls); $app->source->land($startDate, $endDate, $urls); $app->source->leave($startDate, $endDate, $urls); $app->adtag->query($startDate, $endDate, $adTags);
Use in Laravel
Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
$app = app('mta-h5');
License
The MIT License (MIT). Please see License File for more information.