{"_id":"560c93b07e9b9d0d00ca81a8","githubsync":"","project":"560c93ad7e9b9d0d00ca81a2","version":{"_id":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","__v":9,"createdAt":"2015-10-01T02:00:14.709Z","releaseDate":"2015-10-01T02:00:14.709Z","categories":["560c93af7e9b9d0d00ca81a6","560c9d9399bb5a0d0044f220","560d76d899bb5a0d0044f307","560d76ee1ec45619006069ed","560d86e099bb5a0d0044f32e","560dba80373c0e0d0024ff3b","57c722ecdf19130e001fba5d","57c743d1b6f94a2200659903","58995ec083f743190077bbe2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"__v":10,"category":{"_id":"560c93af7e9b9d0d00ca81a6","version":"560c93ae7e9b9d0d00ca81a5","__v":1,"pages":["560c93b07e9b9d0d00ca81a8"],"project":"560c93ad7e9b9d0d00ca81a2","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-01T02:00:15.249Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"user":"560c92f2ac2859170013faa3","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-01T02:00:16.038Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"NOTE: See the Alternate Setup Guides section if you are using Segment.com, Google Tag Manager, Recurly, Stripe or Shopify.\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"1. Install the Snippet\"\n}\n[/block]\nPlace this tracking code on every page of your site, anywhere on the page.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<script type=\\\"text/javascript\\\">\\nwindow.Attribution=window.Attribution||[];window.Attribution.methods=[\\\"trackSubmit\\\",\\\"trackClick\\\",\\\"trackLink\\\",\\\"trackForm\\\",\\\"pageview\\\",\\\"identify\\\",\\\"group\\\",\\\"track\\\",\\\"ready\\\",\\\"alias\\\",\\\"page\\\",\\\"once\\\",\\\"off\\\",\\\"on\\\"];window.Attribution.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.Attribution.push(t);return window.Attribution}};for(var i=0;i<window.Attribution.methods.length;i++){var key=window.Attribution.methods[i];window.Attribution[key]=window.Attribution.factory(key)}window.Attribution.load=function(e){if(document.getElementById(\\\"attribution-js\\\"))return;var t=document.createElement(\\\"script\\\");t.type=\\\"text/javascript\\\";t.id=\\\"attribution-js\\\";t.async=true;t.src=\\\"//scripts.attributionapp.com/attribution.js\\\";var n=document.getElementsByTagName(\\\"script\\\")[0];n.parentNode.insertBefore(t,n)};window.Attribution.load();\\nwindow.Attribution.projectId=\\\"[[app:key]]\\\";\\nwindow.Attribution.page();\\n</script> \",\n \"language\": \"html\"\n },\n {\n \"code\": \"window.Attribution=window.Attribution||[];window.Attribution.methods=[\\\"trackSubmit\\\",\\\"trackClick\\\",\\\"trackLink\\\",\\\"trackForm\\\",\\\"pageview\\\",\\\"identify\\\",\\\"group\\\",\\\"track\\\",\\\"ready\\\",\\\"alias\\\",\\\"page\\\",\\\"once\\\",\\\"off\\\",\\\"on\\\"];window.Attribution.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.Attribution.push(t);return window.Attribution}};for(var i=0;i<window.Attribution.methods.length;i++){var key=window.Attribution.methods[i];window.Attribution[key]=window.Attribution.factory(key)}window.Attribution.load=function(e){if(document.getElementById(\\\"attribution-js\\\"))return;var t=document.createElement(\\\"script\\\");t.type=\\\"text/javascript\\\";t.id=\\\"attribution-js\\\";t.async=true;t.src=\\\"//scripts.attributionapp.com/attribution.js\\\";var n=document.getElementsByTagName(\\\"script\\\")[0];n.parentNode.insertBefore(t,n)};window.Attribution.load();\\nwindow.Attribution.projectId=\\\"YOUR_PROJECT_ID\\\";\\nwindow.Attribution.page();\",\n \"language\": \"javascript\"\n }\n ]\n}\n[/block]\nWhen you paste the snippet, you'll need to change YOUR_APP_KEY to the project id listed in the [settings](https://dashboard.attributionapp.com/#!/settings) page.\n\nAlternatively, if you are integrated with [Segment](https://segment.com/docs/integrations/attribution/), you don't need to add the snippet at all, just enable the Attribution integration on your Segment dashboard.\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"2. Identify Users\"\n}\n[/block]\n`identify` is used to link a users actions and pageviews to a recognizable name or email address. You'll need to identify whenever a user signs up or logs in. We recommend using the user ID field from your database and passing the email address in as a trait, in case a user changes their email address later on. You can pass us as many customer traits as you'd like to save.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"Attribution.identify('00812938', {\\n name: 'Bob Slydell', \\n email: 'bob:::at:::initech.co'\\n});\",\n \"language\": \"javascript\"\n }\n ]\n}\n[/block]\nIf your site requires registration, also include a 'createdAt' date property so that we can tell tell the difference between new and existing customers.\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"3. Track Events\"\n}\n[/block]\ntrack is used to record events. You should use this method to record each step of your conversion funnel. These events should describe the action taken in a way that would be recognizable to anyone in your company. Here's some good examples of funnel events:\n\nSAAS Funnel: Created Account, Completed Account Setup, Entered Credit Card, Purchased Subscription.\n\nShopping Cart Funnel: Added Item to Cart, Viewed Cart, Entered Credit Card, Completed Purchase.\n\nAttribution recognizes the revenue property on the track event and stores it in a special way. Here's an example of an event with the revenue property:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"Attribution.track('Credit Card Charged', {\\n revenue: '79.99'\\n});\",\n \"language\": \"javascript\"\n }\n ]\n}\n[/block]\nMore information can be found in our track docs\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"4. Congratulate Yourself!\"\n}\n[/block]\nThat's it! We sync data to our reporting databases every hour so it won't take long to start seeing customer data on your dashboard.","excerpt":"This page will help you get started with Attribution. You'll be up and running in a jiffy!","slug":"getting-started","type":"basic","title":"Getting Started with Attribution"}
Getting Started with Attribution
This page will help you get started with Attribution. You'll be up and running in a jiffy!