{"action":"created","issue":{"url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/23","repository_url":"https://api.github.com/repos/narkq/react-yandex-metrika","labels_url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/23/comments","events_url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/23/events","html_url":"https://github.com/narkq/react-yandex-metrika/issues/23","id":364895148,"node_id":"MDU6SXNzdWUzNjQ4OTUxNDg=","number":23,"title":"Не считается время на странице, вебвизор без верстки","user":{"login":"nadam131","id":13889241,"node_id":"MDQ6VXNlcjEzODg5MjQx","avatar_url":"https://avatars2.githubusercontent.com/u/13889241?v=4","gravatar_id":"","url":"https://api.github.com/users/nadam131","html_url":"https://github.com/nadam131","followers_url":"https://api.github.com/users/nadam131/followers","following_url":"https://api.github.com/users/nadam131/following{/other_user}","gists_url":"https://api.github.com/users/nadam131/gists{/gist_id}","starred_url":"https://api.github.com/users/nadam131/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadam131/subscriptions","organizations_url":"https://api.github.com/users/nadam131/orgs","repos_url":"https://api.github.com/users/nadam131/repos","events_url":"https://api.github.com/users/nadam131/events{/privacy}","received_events_url":"https://api.github.com/users/nadam131/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-28T13:44:31Z","updated_at":"2018-11-05T09:44:16Z","closed_at":null,"author_association":"NONE","body":"На React SPA проекта с SSR понадобилось подключить Яндекс Метрику. Следовал строго по инструкции. \r\n\r\nВ **App.js** сделал импорты:\r\n```\r\nimport { YMInitializer } from 'react-yandex-metrika'\r\nimport ym from 'react-yandex-metrika'\r\n```\r\n\r\nВ этом же файле добавил хит, при переходе на новый стейт\r\n```\r\ncomponentDidUpdate(prevProps) {\r\n        if (prevProps.location !== this.props.location) {\r\n            console.log('hit')\r\n            ym('hit', prevProps.location.pathname)\r\n        }\r\n   }\r\n```\r\n**Отправляю предыдущую страницу, т.к если отправлять текущую, в метрике не сходятся заголовки.** \r\n\r\nСам инициализатор кидаю в том же **App.js**\r\n```\r\n<ThemeProvider theme={themeDefault}>\r\n    .....            \r\n   <YMInitializer\r\n       accounts={[123456]}\r\n       options={{ webvisor: true }}\r\n       version=\"2\"\r\n     />\r\n    ....\r\n</ThemeProvider>\r\n```\r\n\r\n**Итог** \r\nХиты в метрику приходят, но есть несколько проблем:\r\n\r\n1. Не считается время проведенное на каждой странице. Общее время выводится только на странице входа.\r\n\r\n![image](https://user-images.githubusercontent.com/13889241/46211870-4aca6680-c33d-11e8-8648-32ea432088b6.png)\r\n\r\n2. В вебвизоре почему-то каша \r\n\r\n![image](https://user-images.githubusercontent.com/13889241/46211962-88c78a80-c33d-11e8-82a8-b9acfdeb9189.png)"},"comment":{"url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/comments/435813445","html_url":"https://github.com/narkq/react-yandex-metrika/issues/23#issuecomment-435813445","issue_url":"https://api.github.com/repos/narkq/react-yandex-metrika/issues/23","id":435813445,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTgxMzQ0NQ==","user":{"login":"sneerin","id":6002332,"node_id":"MDQ6VXNlcjYwMDIzMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/6002332?v=4","gravatar_id":"","url":"https://api.github.com/users/sneerin","html_url":"https://github.com/sneerin","followers_url":"https://api.github.com/users/sneerin/followers","following_url":"https://api.github.com/users/sneerin/following{/other_user}","gists_url":"https://api.github.com/users/sneerin/gists{/gist_id}","starred_url":"https://api.github.com/users/sneerin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sneerin/subscriptions","organizations_url":"https://api.github.com/users/sneerin/orgs","repos_url":"https://api.github.com/users/sneerin/repos","events_url":"https://api.github.com/users/sneerin/events{/privacy}","received_events_url":"https://api.github.com/users/sneerin/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T09:44:16Z","updated_at":"2018-11-05T09:44:16Z","author_association":"NONE","body":"Та же проблема, это вообще реально на  SPA получить результаты как у fullstory? "}}
{"actor":{"display_login":"sneerin"}}