B
B
bbaggins2017-08-19 19:12:33
PHP
bbaggins, 2017-08-19 19:12:33

How to make a request on several pages in the Yandex Metrics API?

Hello!
Tell me if it is possible in the Yandex Metrics API to make a request on several pages, the listing is below:

$params = [
    'ids'         => '000000000000000000000,
    'oauth_token' => '000000000000000000000',
    'metrics'     => 'ym:pv:pageviews',
    'dimensions'  => 'ym:pv:date',
    'filters' => "ym:pv:URL=='sitepage.ru'",
    'date1'       => '30daysAgo',
    'date2'       => 'yesterday',
    'sort'        => 'ym:pv:date',
];

An entry like 'filters' => "ym:pv:URL=='sitepage.ru' AND ym:pv:URL=='sitepage2.ru'", does not give any result.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2017-08-19
@bbaggins

Write OR instead of AND.
PS not so long ago I wrote a library for metrics - https://github.com/axp-dev/ya-metrika

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question