{"_id":"55f19da95fe76419007dc732","__v":3,"category":{"_id":"55f1962e3936d52d00fb3c8f","version":"55de06fa57f7b20d0097636e","__v":15,"pages":["55f196903936d52d00fb3c95","55f19c267dccfc0d00986b44","55f19da95fe76419007dc732","55f19ea639e3e8190068b2cc","55f19f7c7dccfc0d00986b4b","55f19fff3936d52d00fb3ca1","55f1a06d39e3e8190068b2d2","55f1a0925fe76419007dc737","55f1a0cb3936d52d00fb3cab","55f1b2be7dccfc0d00986b72","55f1b7d139e3e8190068b300","55f1b7fb229b772300779a4a","55f1be1efd98c42300acc64f","560956518aedf50d0004d0e2","565380daf77ca023004e5321"],"project":"55de06fa57f7b20d0097636b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-10T14:39:42.948Z","from_sync":false,"order":1,"slug":"ios-sdk","title":"iOS SDK"},"user":"55de06e19db51a0d0064947d","parentDoc":null,"project":"55de06fa57f7b20d0097636b","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":"2015-09-10T15:11:37.948Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"You can use PushSpring data inside your application to customize the content you show to users. This data includes Personas.  You could present a different registration experience or feature different ads based on personas.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting Content Customization Data\"\n}\n[/block]\nContent customization data requires a round trip to the PushSpring servers to map signals to the customization data. The call to retrieve the data is asynchronous and requires you to implement a block to receive the results.\n\nContact your PushSpring Account Representative for information on the Personas you can retrieve using this call.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[[PushSpring sharedPushSpring] getCustomerInsights:^(NSDictionary *calculatedAttributes) {\\n    if(calculatedAttributes!=nil) {\\n        for (NSNumber *persona in calculatedAttributes[:::at:::\\\"responses\\\"][@\\\"personas\\\"]) {\\n            //do what you want to do with items\\n            NSLog(@\\\"Persona Id:%@\\\", persona);\\n        }\\n    }\\n}];\\n\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Data Elements\"\n}\n[/block]\n####status\nIf the call succeeds and valid data is returned this NSString will be 'OK'.  'ERROR' will be returned if there was a\nproblem with the backend.\n\n####responses.personas\nThis is an NSArray of persona ids indicating whether that persona was \ndetected. You can download a mapping of persona ids to names [here](https://api.pushspring.com/v1/personas).\n\n####responses.age\nThis is an Integer indicating the age range of the user of the device.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"0\",\n    \"0-1\": \"Unknown\",\n    \"h-0\": \"Value\",\n    \"h-1\": \"Range\",\n    \"1-0\": \"1\",\n    \"1-1\": \"18 - 24\",\n    \"2-0\": \"2\",\n    \"2-1\": \"25 - 34\",\n    \"3-0\": \"3\",\n    \"3-1\": \"35 - 44\",\n    \"4-0\": \"4\",\n    \"4-1\": \"45 - 54\",\n    \"5-0\": \"5\",\n    \"5-1\": \"55 - 64\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n####responses.medianAge\nThis is the median of the age range the user of the device falls into.\n\n###responses.income\nThis is an Integer indicating the income range of the user of the device.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Range\",\n    \"0-0\": \"0\",\n    \"0-1\": \"Unknown\",\n    \"1-0\": \"1\",\n    \"1-1\": \"Under $25,000\",\n    \"2-0\": \"2\",\n    \"2-1\": \"$25,000 - $39,999\",\n    \"3-0\": \"3\",\n    \"3-1\": \"$40,000 - $59,999\",\n    \"4-0\": \"4\",\n    \"4-1\": \"$60,000 - $74,999\",\n    \"5-0\": \"5\",\n    \"5-1\": \"$75,000 - $100,000\",\n    \"6-0\": \"6\",\n    \"6-1\": \"Over $100,000\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n####responses.medianIncome\nThis is the median of the income range the user of the device falls into.","excerpt":"Customize the content you show to users","slug":"content-customization","type":"basic","title":"Content Customization"}

Content Customization

Customize the content you show to users

You can use PushSpring data inside your application to customize the content you show to users. This data includes Personas. You could present a different registration experience or feature different ads based on personas. [block:api-header] { "type": "basic", "title": "Getting Content Customization Data" } [/block] Content customization data requires a round trip to the PushSpring servers to map signals to the customization data. The call to retrieve the data is asynchronous and requires you to implement a block to receive the results. Contact your PushSpring Account Representative for information on the Personas you can retrieve using this call. [block:code] { "codes": [ { "code": "[[PushSpring sharedPushSpring] getCustomerInsights:^(NSDictionary *calculatedAttributes) {\n if(calculatedAttributes!=nil) {\n for (NSNumber *persona in calculatedAttributes[@\"responses\"][@\"personas\"]) {\n //do what you want to do with items\n NSLog(@\"Persona Id:%@\", persona);\n }\n }\n}];\n", "language": "objectivec" } ] } [/block] [block:api-header] { "type": "basic", "title": "Data Elements" } [/block] ####status If the call succeeds and valid data is returned this NSString will be 'OK'. 'ERROR' will be returned if there was a problem with the backend. ####responses.personas This is an NSArray of persona ids indicating whether that persona was detected. You can download a mapping of persona ids to names [here](https://api.pushspring.com/v1/personas). ####responses.age This is an Integer indicating the age range of the user of the device. [block:parameters] { "data": { "0-0": "0", "0-1": "Unknown", "h-0": "Value", "h-1": "Range", "1-0": "1", "1-1": "18 - 24", "2-0": "2", "2-1": "25 - 34", "3-0": "3", "3-1": "35 - 44", "4-0": "4", "4-1": "45 - 54", "5-0": "5", "5-1": "55 - 64" }, "cols": 2, "rows": 6 } [/block] ####responses.medianAge This is the median of the age range the user of the device falls into. ###responses.income This is an Integer indicating the income range of the user of the device. [block:parameters] { "data": { "h-0": "Value", "h-1": "Range", "0-0": "0", "0-1": "Unknown", "1-0": "1", "1-1": "Under $25,000", "2-0": "2", "2-1": "$25,000 - $39,999", "3-0": "3", "3-1": "$40,000 - $59,999", "4-0": "4", "4-1": "$60,000 - $74,999", "5-0": "5", "5-1": "$75,000 - $100,000", "6-0": "6", "6-1": "Over $100,000" }, "cols": 2, "rows": 7 } [/block] ####responses.medianIncome This is the median of the income range the user of the device falls into.