On this page
Yandex.Metrics 7.x-3.x Documentation
The Yandex.Metrics project integrates a website with Yandex.Metrica.
The project consists of two modules, such as Yandex.Metrics Counter and Yandex.Metrics Reports.
Yandex.Metrics Counter
- Installing Yandex.Metrica counter code and configuring its visibility
Yandex.Metrics Reports
- Page Views, Visitors, New Visitors
- Traffic Sources
- Popular Search Phrases
- Popular Content
- Geography of Visits
- Hourly Traffic
- Demography of Visits
Watch video on how to configure the reports and authorize the application on Yandex.
Dependencies
- [For reports] Visualization API
- [For reports] Yandex Services Authorization API
- [Optional, for internationalized domain names] IDNA Convert
Configuration
Yandex.Metrics Counter module
1. On the access control administration page ("Administration >> People >> Permissions") you need to assign:
"Administer Yandex.Metrics Settings" permission to the roles that are allowed to administer the Yandex.Metrics settings.
2. Create Yandex.Metrica account.
Please skip this step if you have already had it.
3. Create Yandex.Metrica counter for your site at Yandex.Metrica admin interface.
Note: We recommend to create simple counter without any widget but counter code with widget is acceptable.
Generate and save this Javascript code for later usage.
Please skip this step if you have already created a counter.
4. Go to the module settings page ("Administration >> Configuration >> System >> Yandex.Metrics")
Users need the "Administer Yandex.Metrics Settings" permission to access this page.
Paste Javascript code of counter from Yandex.Metrica to the Counter Code text field on the Counter Code settings page.
You can also define counter code visibility settings.
Then submit form.
By this step you add counter code to the footer of permitted pages of your site.
Please skip this step if you have already added Yandex.Metrica counter code on your site pages through another way.
5. Domain Access support.
Please skip this step if you don't use Domain Access module.
To configure different counters for different domains follow these steps:
* Install Domain Variable module. It requires Variable module.
* Go to Domain Variables settings page ("Structure" >> "Domains" >> "Variables").
* Open Yandex.Metrics vertical tab and choose which variables should be multidomain.
* Go to Yandex.Metrics settings page ("Administration >> Configuration >> System >> Yandex.Metrics").
You will see domain switcher at the to of the configuration form.
Use it to set custom settings for each of your domains.
Please skip next steps if you need nothing except installation of the counter code.
Yandex.Metrics Reports module
1. On the access control administration page ("Administration >> People >> Permissions") you need to assign:
"Access Yandex.Metrics report" permission to the roles that are allowed to view Yandex.Metrics Summary Report
2. Register Yandex application and authorize your site following Yandex Services Authorization API module documentation.
Make sure that you granted "Яндекс.Метрика" -> "Получение статистики, чтение параметров своих и доверенных счётчиков" permission to the Yandex application.
3. Reports settings
Go to Reports tab ("Administration >> Configuration >> System >> Yandex.Metrics >> Reports") to enable or disable some of the reports.
4. Check Yandex.Metrics Summary Report content ("Administration >> Reports >> Yandex.Metrics Summary Report").
To access this page users need the "Access Yandex.Metrics report" permission.
Note: Your report can be empty if you have just created Yandex.Metrics counter and placed it to your site. Probably statistic information have not been collected yet.
Please try again later.
Development
Read how to write own plugins for Yandex.Metrics Reports module in the Yandex.Metrics Reports API Documentation.
Thanks to all great guys who have ever contributed to the project!
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion