{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Google Tag Manager","type":"basic","slug":"google-tag-manager","excerpt":"How Google Tag Manager can help with installing Attribution","body":"Google Tag Manager (GTM) is a tool for injecting snippets of code onto a website based on rules that you set in the [GTM app](https://tagmanager.google.com/).  \n\nThe basic concept for the Attribution app integration is that we want to inject the main attribution snippet on every page, one time, right when that page is loaded. You can inject page() to run analytics.js via Google tag manager. \n\n****However, you cannot install Attribution.identify() OR Attribution.track() with Google Tag Manager****\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/79cb384-download_2.png\",\n        \"download (2).png\",\n        294,\n        172,\n        \"#333\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Inject the Attribution app snippet on every page\"\n}\n[/block]\nThe first thing we want to do is inject the main attribution app snippet on every page, one time, right when that page is loaded. To do this we will click to create a new tag, and select \"Custom HTML Tag\".  Then, paste the code from your [Attribution settings](https://dashboard.attributionapp.com/#!/settings).\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fCF6O20ASwegN4uK8aV7_attribution-tag.png\",\n        \"attribution-tag.png\",\n        \"1936\",\n        \"1610\",\n        \"#380f1c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou will want to make sure that the code is triggered on all pages.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Tag Firing Priority\",\n  \"body\": \"This tag has to be fired before any other Attribution app tags. In order to do this, you'll need to assign it a \\\"Tag firing priority\\\" of greater than 0. Tags with higher numbers for priority will be fired first.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"GTM uses a noscript IFrame to allow for scriptless tracking. However, this is generally only used by bots. In order to ignore these bot events, and keep your data clean, we advise wrapping all Attribution app code snippets in an if statement:\\n\\n```javascript\\n<script type=\\\"text/javascript\\\">\\n  if (document.location.href.search('gtm-msr.appspot') == -1) {\\n    /* Attribution code here */\\n  }\\n</script>\\n```\\nAlthough, this is not shown in the screenshots, it should be added to all tags.\",\n  \"title\": \"Robot Proofing\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"A note on using GTM\"\n}\n[/block]\nIt is technically possible to instal track() and identify() using Google tag manager, but it is a very complex process. When calling identify() or track() Attribution will look for a userId or anonymous cookieId, in most cases Google Tag Manager will not pass the anonymous cookieId which prevents tying events to visitors in Attribution.","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"560dbc768e6f870d004e3e6a","project":"560c93ad7e9b9d0d00ca81a2","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["560c93af7e9b9d0d00ca81a6","560c9d9399bb5a0d0044f220","560d76d899bb5a0d0044f307","560d76ee1ec45619006069ed","560d86e099bb5a0d0044f32e","560dba80373c0e0d0024ff3b","57c722ecdf19130e001fba5d","57c743d1b6f94a2200659903","58995ec083f743190077bbe2","5fabfb070e9b0600424707dd","60004359deee820012dc1efc","600060c72dcd9d002fa13656","6001ac08c104fe002b933b7c","6009604d81b288001417df30","60097b7be8ec1e00334419f6","600aa98de28fae003a33108a","600aa9ee7d3e350018e7d6e4","601176819ca8c90011cfe6ac","606eef795bb7ed00790e9e68"],"_id":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","createdAt":"2015-10-01T02:00:14.709Z","releaseDate":"2015-10-01T02:00:14.709Z","__v":19},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"FAQ when installing","slug":"faq-when-installing","order":2,"from_sync":false,"reference":false,"_id":"600060c72dcd9d002fa13656","createdAt":"2021-01-14T15:18:31.879Z","version":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","__v":0},"user":"560c92f2ac2859170013faa3","__v":11,"parentDoc":null,"createdAt":"2015-10-01T23:06:30.033Z","githubsync":""}

Google Tag Manager

How Google Tag Manager can help with installing Attribution

Google Tag Manager (GTM) is a tool for injecting snippets of code onto a website based on rules that you set in the [GTM app](https://tagmanager.google.com/). The basic concept for the Attribution app integration is that we want to inject the main attribution snippet on every page, one time, right when that page is loaded. You can inject page() to run analytics.js via Google tag manager. ****However, you cannot install Attribution.identify() OR Attribution.track() with Google Tag Manager**** [block:image] { "images": [ { "image": [ "https://files.readme.io/79cb384-download_2.png", "download (2).png", 294, 172, "#333" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "1. Inject the Attribution app snippet on every page" } [/block] The first thing we want to do is inject the main attribution app snippet on every page, one time, right when that page is loaded. To do this we will click to create a new tag, and select "Custom HTML Tag". Then, paste the code from your [Attribution settings](https://dashboard.attributionapp.com/#!/settings). [block:image] { "images": [ { "image": [ "https://files.readme.io/fCF6O20ASwegN4uK8aV7_attribution-tag.png", "attribution-tag.png", "1936", "1610", "#380f1c", "" ] } ] } [/block] You will want to make sure that the code is triggered on all pages. [block:callout] { "type": "info", "title": "Tag Firing Priority", "body": "This tag has to be fired before any other Attribution app tags. In order to do this, you'll need to assign it a \"Tag firing priority\" of greater than 0. Tags with higher numbers for priority will be fired first." } [/block] [block:callout] { "type": "warning", "body": "GTM uses a noscript IFrame to allow for scriptless tracking. However, this is generally only used by bots. In order to ignore these bot events, and keep your data clean, we advise wrapping all Attribution app code snippets in an if statement:\n\n```javascript\n<script type=\"text/javascript\">\n if (document.location.href.search('gtm-msr.appspot') == -1) {\n /* Attribution code here */\n }\n</script>\n```\nAlthough, this is not shown in the screenshots, it should be added to all tags.", "title": "Robot Proofing" } [/block] [block:api-header] { "title": "A note on using GTM" } [/block] It is technically possible to instal track() and identify() using Google tag manager, but it is a very complex process. When calling identify() or track() Attribution will look for a userId or anonymous cookieId, in most cases Google Tag Manager will not pass the anonymous cookieId which prevents tying events to visitors in Attribution.