{"_id":"57d698414340330e00953c9e","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,"user":"564f641651f2ec0d001d6998","category":{"_id":"57d698404340330e00953c71","version":"57d698404340330e00953c6c","__v":0,"project":"564f643f33082f0d001bb714","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-02T13:07:47.761Z","from_sync":false,"order":4,"slug":"настройка-событий-в-gtm","title":"Настройка DDM через GTM"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-02T13:37:30.255Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Важно!\",\n  \"body\": \"Убедитесь, что Google Tag Manager загружается на страницу после определения объекта **window.digitalData**.\"\n}\n[/block]\n## Шаг 1: \nСоздайте новый тег для сниппета Digital Data Manager с названием \"DDM - Snippet\". \n\nКод сниппета:\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\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Важно!\",\n  \"body\": \"Вместо {PROJECT_ID} укажите ID своего проекта в панели DigitalDataManager - http://www.ddmanager.ru\"\n}\n[/block]\n## ШАГ 2:\nВ качестве триггера выберите \"Все страницы\" (All Pages).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/457f739-Google_Tag_Manager_2016-12-06_15-14-50.png\",\n        \"Google Tag Manager 2016-12-06 15-14-50.png\",\n        1186,\n        762,\n        \"#ecebeb\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"установка-digital-data-manager","type":"basic","title":"Установка DigitalDataManager"}

Установка DigitalDataManager


[block:callout] { "type": "warning", "title": "Важно!", "body": "Убедитесь, что Google Tag Manager загружается на страницу после определения объекта **window.digitalData**." } [/block] ## Шаг 1: Создайте новый тег для сниппета Digital Data Manager с названием "DDM - Snippet". Код сниппета: [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] [block:callout] { "type": "warning", "title": "Важно!", "body": "Вместо {PROJECT_ID} укажите ID своего проекта в панели DigitalDataManager - http://www.ddmanager.ru" } [/block] ## ШАГ 2: В качестве триггера выберите "Все страницы" (All Pages). [block:image] { "images": [ { "image": [ "https://files.readme.io/457f739-Google_Tag_Manager_2016-12-06_15-14-50.png", "Google Tag Manager 2016-12-06 15-14-50.png", 1186, 762, "#ecebeb" ] } ] } [/block]