Skip to content

Commit 63e265f

Browse files
committed
Поправил README
1 parent 103f3ef commit 63e265f

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
`npm install yametrika`
4343

4444
## Использование
45-
```JavaScript
45+
```js
4646
var http = require('http');
4747

4848
// Создаем счётчик, 12345 - номер счётчика
@@ -51,43 +51,43 @@ var counter = require('yametrika').counter({id: 12345});
5151
http.createServer(function (req, res) {
5252
res.writeHead(200, {'Content-Type': 'text/plain'});
5353
res.end('okay');
54-
54+
5555
// Заполняем нужные данные из запроса к серверу для отправки данных в Метрику
5656
counter.req(req);
57-
57+
5858
// Страница http://example.com, с заголовком 'Main page'
5959
// переход был с http://google.com (реферер)
6060
counter.hit('http://example.com', 'Main page', 'http://google.com');
61-
}).listen(8080);
62-
```
63-
61+
}).listen(8080);
62+
```
63+
6464
## Отправка хита
65-
```JavaScript
65+
```js
6666
/**
6767
* @param {string} pageUrl - адрес страницы
6868
* @param {string} [pageTitle] - заголовок страницы
6969
* @param {string} [pageRef] - реферер страницы
7070
* @param {Object} [userParams] - параметры визитов
7171
* @param {string} [ut] - для запрета индексирования 'noindex'
7272
* @return {Object} this
73-
*
73+
*
7474
* hit: function (pageUrl, pageTitle, pageRef, userParams, ut) {}
75-
*/
76-
75+
*/
76+
7777
counter.hit('http://mysite.org', 'Main page', 'http://google.com/...');
7878

7979
// С запретом на индексирование и параметрами визитов
8080
counter.hit('http://mysite.org', 'Main page', 'http://google.com/...', {level1: {level2: 1}}, 'noindex');
81-
```
82-
81+
```
82+
8383
## Достижение цели
84-
```JavaScript
84+
```js
8585
/**
8686
* @param {string} target - название цели
8787
* @param {Object} [userParams] - параметры визитов
88-
*
88+
*
8989
* reachGoal: function (target, userParams) {}
90-
*/
90+
*/
9191

9292
counter.hit();
9393
counter.reachGoal('goalName');
@@ -97,64 +97,64 @@ counter.reachGoal('goalName');
9797
// С параметрами визитов
9898
counter.hit();
9999
counter.reachGoal('goalName', {level1: {level2: 1}});
100-
```
100+
```
101101
Вызов метода `hit()` перед `reachGoal()` необходим для корректной привязки цели к визиту.
102102

103103
## Внешняя ссылка
104-
```JavaScript
104+
```js
105105
/**
106106
* @param {string} url - адрес страницы
107107
* @param {string} [title] - заголовок страницы
108108
* @return {Object} this
109-
*
109+
*
110110
* extLink: function (url, title) {}
111111
* @example
112-
*/
113-
114-
counter.extLink('http://nodejs.org');
115-
```
112+
*/
116113

117-
## Загрузка файла
118-
```JavaScript
114+
counter.extLink('http://nodejs.org');
115+
```
116+
117+
## Загрузка файла
118+
```js
119119
/**
120120
* @param {string} file - ссылка на файл
121121
* @param {string} [title] - заголовок страницы
122122
* @return {Object} this
123-
*
123+
*
124124
* file: function (file, title) {}
125-
*/
126-
125+
*/
126+
127127
counter.file('http://mysite.org/secret.zip');
128-
```
129-
128+
```
129+
130130
## Параметры визитов
131-
```JavaScript
131+
```js
132132
/**
133133
* @param {...*} параметры визитов
134-
* @return {Object} this
135-
*
134+
* @return {Object} this
135+
*
136136
* params: function (...) {}
137-
*/
138-
137+
*/
138+
139139
counter.params({level1: {level2: {level3: 1}}});
140140

141141
// или
142142
counter.params('level1', 'level2', 'level3', 1);
143-
```
144-
143+
```
144+
145145
## Не отказ
146-
```JavaScript
146+
```js
147147
/**
148148
* @return {Object} this
149-
*
149+
*
150150
*/
151-
151+
152152
counter.notBounce();
153-
```
154-
153+
```
154+
155155
## Полезные ссылки
156156
+ [Версия для PHP](https://github.com/hcodes/server_yametrika/)
157-
+ [Помощь Яндекс.Метрики](http://help.yandex.ru/metrika/)
157+
+ [Помощь Яндекс.Метрики](https://yandex.ru/support/metrika/)
158158

159159
## Лицензия
160160
MIT License

0 commit comments

Comments
 (0)