@appigram/react-yandex-metrika 2.8.7 → 2.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -11
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
- react-yandex-metrika
2
- ======================
1
+ # react-yandex-metrika
2
+
3
+ #### Code is used on
4
+
5
+ https://ryfma.com/
6
+
7
+ ### Instructions
3
8
 
4
9
  Adds the Yandex.Metrika script to your page and exposes the `ym` tracking
5
10
  function as a module.
@@ -9,6 +14,7 @@ Inspired by and shamelessly copied from [react-google-analytics](https://github.
9
14
  Usage:
10
15
 
11
16
  Use the initializer to add the script to your page somewhere:
17
+
12
18
  ```javascript
13
19
  import { YMInitializer } from 'react-yandex-metrika';
14
20
 
@@ -28,38 +34,41 @@ class MyComponent extends React.Component {
28
34
  Please note that you need to initialize the tracker object only once.
29
35
  Because of that, you should insert initializer to the place where it won't be remounted (that means at least outside of router scope).
30
36
  If you want to use [webvisor](https://metrika.yandex.ru/promo/webvisor), you should pass `options={{webvisor: true}}` to to `YMInitializer`, for example:
37
+
31
38
  ```
32
39
  <YMInitializer accounts={[987654321]} options={{webvisor: true}}/>
33
40
  ```
34
41
 
35
-
36
42
  You can create several identical trackers (that might be useful for domain-wise segmentation).
43
+
37
44
  ```javascript
38
45
  <YMInitializer accounts={[98765, 4321]} />
39
46
  ```
40
47
 
41
48
  You can also specify options for tracker (as described in [Yandex.Metrika documentation](https://help.yandex.ru/metrika/objects/creating-object.xml)):
49
+
42
50
  ```javascript
43
- <YMInitializer accounts={[98765]} options={{defer: true}} />
51
+ <YMInitializer accounts={[98765]} options={{ defer: true }} />
44
52
  ```
45
53
 
46
54
  Elsewhere, use the `ym` function:
47
55
 
48
56
  ```javascript
49
- import ym from 'react-yandex-metrika';
50
- ym('hit', '/cart');
51
- ym('reachGoal', 'whateverGoal', {awesomeParameter: 42});
57
+ import ym from "react-yandex-metrika";
58
+ ym("hit", "/cart");
59
+ ym("reachGoal", "whateverGoal", { awesomeParameter: 42 });
52
60
  ```
53
61
 
54
62
  ### Webvisor 2.0 support
55
63
 
56
64
  See [#6](https://github.com/narkq/react-yandex-metrika/issues/6) for details.
65
+
57
66
  ```javascript
58
- <YMInitializer accounts={[31337]} options={{webvisor: true}} version="2" />
67
+ <YMInitializer accounts={[31337]} options={{ webvisor: true }} version="2" />
59
68
  ```
60
69
 
61
70
  ### Migration from 1.0
62
71
 
63
- - Replace `import { Initializer }` to `import { YMInitializer }`.
64
- - Remove `ym.init()` call. Pass arguments of `ym.init` as props to the `YMInitializer` component.
65
- Tracking will be initialized on `YMInitializer.componentDidMount`.
72
+ - Replace `import { Initializer }` to `import { YMInitializer }`.
73
+ - Remove `ym.init()` call. Pass arguments of `ym.init` as props to the `YMInitializer` component.
74
+ Tracking will be initialized on `YMInitializer.componentDidMount`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appigram/react-yandex-metrika",
3
- "version": "2.8.7",
3
+ "version": "2.8.8",
4
4
  "description": "Yandex Metrika(beta) component for React",
5
5
  "main": "./lib/index.js",
6
6
  "scripts": {