{"_id":"59dd5abd80dd65003a375779","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"},"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","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-10T23:41:49.230Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Imported data cannot be deleted!\",\n  \"body\": \"Once you import data, it cannot be deleted.  We recommend that you set up a new project for testing prior to importing you data into production.  You can set up a new project on paid plans by clicking on your avatar on the top right of the Dashboard and clicking the \\\"New Project\\\" button.\"\n}\n[/block]\nSend your data to the appropriate endpoints to add it to Attribution App: [/track](https://docs.attributionapp.com/docs/track) for pageviews and custom events, and [/identify](https://docs.attributionapp.com/docs/identify-1) for loading or updating user information.\n\nEvery event or pageview must have either \"cookie_id\" or \"user_id\" set; otherwise Attribution App will not be able to track the event. \"Loaded a Page\" is a reserved event name and **must** be the event name used to track page views - any other name will be considered a custom event. \n\n\"timestamp\" attribute uses the ISO8601 format.  It is critical that you set this properly for the time/date that the event occured.\n\nExample of pageview payload:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"cookie_id\\\": \\\"23adfd82-aa0f-8383-a756-24f2a7a4c895\\\",\\n  \\\"event\\\": \\\"Loaded a Page\\\",\\n  \\\"properties\\\": {\\n    \\\"path\\\": \\\"/collections/mens-bottoms-sweatpants\\\",\\n    \\\"referrer\\\": \\\"https://www.domain.com/cart\\\",\\n    \\\"search\\\": \\\"\\\",\\n    \\\"title\\\": \\\"Mens Bottoms Sweatpants\\\".\\n    \\\"url\\\": \\\"https://www.domain.com/collections/mens-bottoms-sweatpants\\\"\\n  },\\n  \\\"timestamp\\\": \\\"2015-12-12T19:11:01.249Z\\\",\\n  \\\"user_id\\\": null\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\nExample of custom event payload:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"cookie_id\\\": null,\\n  \\\"event\\\": \\\"Order Paid\\\",\\n  \\\"properties\\\": {\\n    \\\"revenue\\\": \\\"59.99\\\"\\n  },\\n  \\\"timestamp\\\": \\\"2015-12-14T19:09:17.542Z\\\",\\n  \\\"user_id\\\": 12345\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nIdentify calls are not tied to a timestamp and can be sent anytime you want to create or update a record. However, you should call identify() anytime a user signs up or signs in so that we can us it to bind anon traffic with known traffic.","excerpt":"","slug":"importing-historical-data-into-attribution","type":"basic","title":"Importing Historical Data Into Attribution"}

Importing Historical Data Into Attribution


[block:callout] { "type": "danger", "title": "Imported data cannot be deleted!", "body": "Once you import data, it cannot be deleted. We recommend that you set up a new project for testing prior to importing you data into production. You can set up a new project on paid plans by clicking on your avatar on the top right of the Dashboard and clicking the \"New Project\" button." } [/block] Send your data to the appropriate endpoints to add it to Attribution App: [/track](https://docs.attributionapp.com/docs/track) for pageviews and custom events, and [/identify](https://docs.attributionapp.com/docs/identify-1) for loading or updating user information. Every event or pageview must have either "cookie_id" or "user_id" set; otherwise Attribution App will not be able to track the event. "Loaded a Page" is a reserved event name and **must** be the event name used to track page views - any other name will be considered a custom event. "timestamp" attribute uses the ISO8601 format. It is critical that you set this properly for the time/date that the event occured. Example of pageview payload: [block:code] { "codes": [ { "code": "{\n \"cookie_id\": \"23adfd82-aa0f-8383-a756-24f2a7a4c895\",\n \"event\": \"Loaded a Page\",\n \"properties\": {\n \"path\": \"/collections/mens-bottoms-sweatpants\",\n \"referrer\": \"https://www.domain.com/cart\",\n \"search\": \"\",\n \"title\": \"Mens Bottoms Sweatpants\".\n \"url\": \"https://www.domain.com/collections/mens-bottoms-sweatpants\"\n },\n \"timestamp\": \"2015-12-12T19:11:01.249Z\",\n \"user_id\": null\n}", "language": "text" } ] } [/block] Example of custom event payload: [block:code] { "codes": [ { "code": "{\n \"cookie_id\": null,\n \"event\": \"Order Paid\",\n \"properties\": {\n \"revenue\": \"59.99\"\n },\n \"timestamp\": \"2015-12-14T19:09:17.542Z\",\n \"user_id\": 12345\n}", "language": "text" } ] } [/block] Identify calls are not tied to a timestamp and can be sent anytime you want to create or update a record. However, you should call identify() anytime a user signs up or signs in so that we can us it to bind anon traffic with known traffic.