{"_id":"57d698404340330e00953c75","category":{"_id":"57d698404340330e00953c70","version":"57d698404340330e00953c6c","__v":0,"project":"564f643f33082f0d001bb714","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-02T11:53:18.476Z","from_sync":false,"order":3,"slug":"digital-data-manager","title":"Digital Data Manager"},"user":"564f641651f2ec0d001d6998","parentDoc":null,"project":"564f643f33082f0d001bb714","version":{"_id":"57d698404340330e00953c6c","project":"564f643f33082f0d001bb714","__v":2,"createdAt":"2016-09-12T11:57:52.437Z","releaseDate":"2016-09-12T11:57:52.437Z","categories":["57d698404340330e00953c6d","57d698404340330e00953c6e","57d698404340330e00953c6f","57d698404340330e00953c70","57d698404340330e00953c71","57d698404340330e00953c72","57d698404340330e00953c73","58a5711c79ac232f00cbadb5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"__v":1,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-22T14:31:45.498Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Установка сниппета\"\n}\n[/block]\nУстановить Digital Data Manager асинхронно на свой сайт можно с помощью следующего сниппета (новые версии будут обновляться автоматически):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javascript\\\">\\n(function(e){var a=window.ddManager=window.ddManager||[];window.ddListener=window.ddListener||[];var b=window.digitalData=window.digitalData||{};b.events=b.events||[];if(!a.initialize)if(a.invoked)window.console&&console.error&&console.error(\\\"Digital Data Manager snippet included twice.\\\");else{a.invoked=!0;a.methods=\\\"initialize addIntegration persist unpersist on once off\\\".split(\\\" \\\");a.factory=function(f){return function(){var c=Array.prototype.slice.call(arguments);c.unshift(f);a.push(c);return a}};\\nfor(b=0;b<a.methods.length;b++){var d=a.methods[b];a[d]=a.factory(d)}a.load=function(a){var c=document.createElement(\\\"script\\\");c.type=\\\"text/javascript\\\";c.async=!0;c.src=a;a=document.getElementsByTagName(\\\"script\\\")[0];a.parentNode.insertBefore(c,a)};a.loadProject=function(b){var c=window.location.search;0<=c.indexOf(\\\"ddm_test_mode=1\\\")?window.localStorage.setItem(\\\"_ddm_test_mode\\\",\\\"1\\\"):0<=c.indexOf(\\\"ddm_test_mode=1\\\")&&window.localStorage.removeItem(\\\"_ddm_test_mode\\\");b=\\\"1\\\"===window.localStorage.getItem(\\\"_ddm_test_mode\\\")?\\n\\\"//api.ddmanager.ru/v1/ddm-initialization/\\\"+b+\\\".js\\\":\\\"//cdn.ddmanager.ru/ddm-initialization/\\\"+b+\\\".js\\\";a.load(b)};a.SNIPPET_VERSION=\\\"1.0.3\\\";a.loadProject(e)}})(\\\"{PROJECT_ID}\\\");\\n</script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nДанный сниппет необходимо разместить **сразу же после определения объекта window.digitalData**.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Важно!\",\n  \"body\": \"Вместо {PROJECT_ID} укажите ID своего проекта в панели DigitalDataManager - http://www.ddmanager.ru\"\n}\n[/block]","excerpt":"","slug":"digital-data-manager","type":"basic","title":"Установка"}

Установка


[block:api-header] { "type": "basic", "title": "Установка сниппета" } [/block] Установить Digital Data Manager асинхронно на свой сайт можно с помощью следующего сниппета (новые версии будут обновляться автоматически): [block:code] { "codes": [ { "code": "<script type=\"text/javascript\">\n(function(e){var a=window.ddManager=window.ddManager||[];window.ddListener=window.ddListener||[];var b=window.digitalData=window.digitalData||{};b.events=b.events||[];if(!a.initialize)if(a.invoked)window.console&&console.error&&console.error(\"Digital Data Manager snippet included twice.\");else{a.invoked=!0;a.methods=\"initialize addIntegration persist unpersist on once off\".split(\" \");a.factory=function(f){return function(){var c=Array.prototype.slice.call(arguments);c.unshift(f);a.push(c);return a}};\nfor(b=0;b<a.methods.length;b++){var d=a.methods[b];a[d]=a.factory(d)}a.load=function(a){var c=document.createElement(\"script\");c.type=\"text/javascript\";c.async=!0;c.src=a;a=document.getElementsByTagName(\"script\")[0];a.parentNode.insertBefore(c,a)};a.loadProject=function(b){var c=window.location.search;0<=c.indexOf(\"ddm_test_mode=1\")?window.localStorage.setItem(\"_ddm_test_mode\",\"1\"):0<=c.indexOf(\"ddm_test_mode=1\")&&window.localStorage.removeItem(\"_ddm_test_mode\");b=\"1\"===window.localStorage.getItem(\"_ddm_test_mode\")?\n\"//api.ddmanager.ru/v1/ddm-initialization/\"+b+\".js\":\"//cdn.ddmanager.ru/ddm-initialization/\"+b+\".js\";a.load(b)};a.SNIPPET_VERSION=\"1.0.3\";a.loadProject(e)}})(\"{PROJECT_ID}\");\n</script>", "language": "html" } ] } [/block] Данный сниппет необходимо разместить **сразу же после определения объекта window.digitalData**. [block:callout] { "type": "warning", "title": "Важно!", "body": "Вместо {PROJECT_ID} укажите ID своего проекта в панели DigitalDataManager - http://www.ddmanager.ru" } [/block]