{"_id":"58ed1f92068f780f00f646ea","project":"55de06fa57f7b20d0097636b","__v":0,"parentDoc":null,"category":{"_id":"58ed1bdc068f780f00f64602","__v":0,"project":"55de06fa57f7b20d0097636b","version":"55de06fa57f7b20d0097636e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-04-11T18:09:32.839Z","from_sync":false,"order":11,"slug":"data-transfer-and-integration","title":"Data Transfer and Integration"},"user":"55de06e19db51a0d0064947d","version":{"_id":"55de06fa57f7b20d0097636e","project":"55de06fa57f7b20d0097636b","__v":14,"createdAt":"2015-08-26T18:35:38.642Z","releaseDate":"2015-08-26T18:35:38.642Z","categories":["55de06fb57f7b20d0097636f","55f1962e3936d52d00fb3c8f","55f1970339e3e8190068b2b8","55f1970d229b772300779a1f","55f1971cfd98c42300acc605","55f1d5c7fd98c42300acc69f","563cbfe4260dde0d00c5e9d4","5644cf437f1fff210078e690","57dc1bbd3ed3450e00dc9ea7","58a600a2243dd30f00fd8773","58ed1bdc068f780f00f64602","58f13b3a4f0ee50f00e24e81","58f173f792f9020f009cad16","591b42f8e633fd0f00077c5a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-11T18:25:22.226Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Custom segments are delivered in a single set of files for each segment with a simple file format.  Each row in the file consists of a device advertising identifier, an integer signifying the type and a segment id.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"1\",\n    \"1-0\": \"2\",\n    \"2-0\": \"3\",\n    \"0-1\": \"iOS IDFA\",\n    \"1-1\": \"Android Device Id (SHA1)\",\n    \"2-1\": \"Android Advertising Identifier\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\nThe following sample file assumes the segment id being exported is 12345.\n\n**Sample File**: \n[https://s3-us-west-2.amazonaws.com/public.pushspring.com/sampleexportformats/custom_segments/custom_segment_sample.csv.gz](https://s3-us-west-2.amazonaws.com/public.pushspring.com/sampleexportformats/custom_segments/custom_segment_sample.csv.gz)\n\nCustom segments will be delivered to an Amazon S3 path provided by us.  We will provide you with IAM credentials to access the data.\n[block:api-header]\n{\n  \"title\": \"Paths\"\n}\n[/block]\nWhen we send a custom segment to S3 it will go to a path like s3://partners.pushspring.com/<partner>/<YYYYMMDD>/<segmentId>/*\n\nThere will be multiple files that make up each segment in this path.\n\nYou are free to delete each file after processing it to aid in tracking which files you have ingested.  We will automatically delete files older than 30 days.\n\n\n[block:api-header]\n{\n  \"title\": \"COMPLETE Marker file\"\n}\n[/block]\nEach send will consist of multiple files.  To make it clear when the send is complete a file named \"COMPLETE\" will be written to the S3 Path.\n\nThis file contains json that describes the segment being sent. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n{  \\n   \\\"segmentId\\\":123,\\n   \\\"rowCount\\\":1790991,\\n   \\\"name\\\":\\\"Test Custom Segment\\\",\\n   \\\"createdAt\\\":\\\"2016-11-03T16:44:51.451Z\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe createdAt data represents when the customer initially created the custom segment on our platform.\n[block:api-header]\n{\n  \"title\": \"Data Refresh\"\n}\n[/block]\nWhen a user pushes a segment from our console data should be available in 5 minutes - 1 hour depending on the load on the system at the time.\n\nAfter the initial push we will push an update every 7 days for the first 28 days.  After that data will be pushed every 28 days.\n\nWe watch usage of the segment and stop pushing data once we see no usage in the prior month.","excerpt":"","slug":"custom-segments","type":"basic","title":"Custom Segments"}
Custom segments are delivered in a single set of files for each segment with a simple file format. Each row in the file consists of a device advertising identifier, an integer signifying the type and a segment id. [block:parameters] { "data": { "0-0": "1", "1-0": "2", "2-0": "3", "0-1": "iOS IDFA", "1-1": "Android Device Id (SHA1)", "2-1": "Android Advertising Identifier" }, "cols": 2, "rows": 3 } [/block] The following sample file assumes the segment id being exported is 12345. **Sample File**: [https://s3-us-west-2.amazonaws.com/public.pushspring.com/sampleexportformats/custom_segments/custom_segment_sample.csv.gz](https://s3-us-west-2.amazonaws.com/public.pushspring.com/sampleexportformats/custom_segments/custom_segment_sample.csv.gz) Custom segments will be delivered to an Amazon S3 path provided by us. We will provide you with IAM credentials to access the data. [block:api-header] { "title": "Paths" } [/block] When we send a custom segment to S3 it will go to a path like s3://partners.pushspring.com/<partner>/<YYYYMMDD>/<segmentId>/* There will be multiple files that make up each segment in this path. You are free to delete each file after processing it to aid in tracking which files you have ingested. We will automatically delete files older than 30 days. [block:api-header] { "title": "COMPLETE Marker file" } [/block] Each send will consist of multiple files. To make it clear when the send is complete a file named "COMPLETE" will be written to the S3 Path. This file contains json that describes the segment being sent. [block:code] { "codes": [ { "code": "\n{ \n \"segmentId\":123,\n \"rowCount\":1790991,\n \"name\":\"Test Custom Segment\",\n \"createdAt\":\"2016-11-03T16:44:51.451Z\"\n}", "language": "json" } ] } [/block] The createdAt data represents when the customer initially created the custom segment on our platform. [block:api-header] { "title": "Data Refresh" } [/block] When a user pushes a segment from our console data should be available in 5 minutes - 1 hour depending on the load on the system at the time. After the initial push we will push an update every 7 days for the first 28 days. After that data will be pushed every 28 days. We watch usage of the segment and stop pushing data once we see no usage in the prior month.