LaravelPackages.net
Acme Inc.
Toggle sidebar
pugofka/yametrika-sdk-laravel

Laravel package for Yandex Metrika SDK

65
5
0.2.0
About pugofka/yametrika-sdk-laravel

pugofka/yametrika-sdk-laravel is a Laravel package for laravel package for yandex metrika sdk. It currently has 5 GitHub stars and 65 downloads on Packagist (latest version 0.2.0). Install it with composer require pugofka/yametrika-sdk-laravel. Discover more Laravel packages by pugofka or browse all Laravel packages to compare alternatives.

Last updated

Laravel SDK client to Yandex.Metrika service

This is not offical package. Can work with static configuration for one project and with dynamically configuration at runtime for SAAS.

Usage

  1. Create new app link
  2. Set app_id to config
  3. use getAuthTokenLink() for for auth link. Docs for work with Yandex Oauth. Set token for static resource or use this example for set it for dinamyc resources:
use Pugofka\Yametrika\YametrikaClient;

class AwesomeClass {
    
    public function setToken(YametrikaClient $client) 
    {
        $client->setToken('your_token');
    }
}

YametrikaClient class is singleton.

Counters

YametrikaCounters class response for work with counters. getCounters() method return array of counters

Reports

Before use Reports, you should set app_id, token and counter_id.

Ecom report

Get data for ecom reports.

$ecomReport = resolve(\Pugofka\Yametrika\YametrikaEcomReports::class);
$ecomData = $ecomReport->getEcomData(\Carbon\Carbon::today()->subYears(1), \Carbon\Carbon::today(), $limit = 500, $offset = 1);
$ecomSources = $ecomReport->getEcomSourcesReport(\Carbon\Carbon::today()->subWeek(), \Carbon\Carbon::today(), $limit = 500, $offset = 1);

Star History Chart