{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Custom Segments","type":"basic","slug":"custom-segments","excerpt":"","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:callout]\n{\n \"type\": \"warning\",\n \"body\": \"We do not support sending to a partner controlled bucket. We will provide access to a PushSpring controlled bucket for this integration.\",\n \"title\": \"S3 Bucket Limitation\"\n}\n[/block]\n\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.","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5dd81acdb8c91603c41dfef8","githubsync":"","project":"55de06fa57f7b20d0097636b","__v":0,"parentDoc":null,"createdAt":"2017-04-11T18:25:22.226Z","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Data Transfer and Integration","slug":"data-transfer-and-integration","order":11,"from_sync":false,"reference":false,"_id":"5dd81acdb8c91603c41dfec3","__v":0,"project":"55de06fa57f7b20d0097636b","version":"5dd81acdb8c91603c41dff08","createdAt":"2017-04-11T18:09:32.839Z"},"user":"55de06e19db51a0d0064947d","version":{"version":"2.0","version_clean":"2.0.0","codename":"PostSDK","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5dd81acdb8c91603c41dfeba","5dd81acdb8c91603c41dfebb","5dd81acdb8c91603c41dfebc","5dd81acdb8c91603c41dfebd","5dd81acdb8c91603c41dfebe","5dd81acdb8c91603c41dfebf","563cbfe4260dde0d00c5e9d4","5dd81acdb8c91603c41dfec0","5dd81acdb8c91603c41dfec1","5dd81acdb8c91603c41dfec2","5dd81acdb8c91603c41dfec3","5dd81acdb8c91603c41dfec4","5dd81acdb8c91603c41dfec5","5dd81acdb8c91603c41dfec6"],"_id":"5dd81acdb8c91603c41dff08","project":"55de06fa57f7b20d0097636b","__v":0,"forked_from":"55de06fa57f7b20d0097636e","createdAt":"2015-08-26T18:35:38.642Z","releaseDate":"2015-08-26T18:35:38.642Z"}}