{"_id":"55781fe45129590d003ff51c","project":"54aa7f773b56130b0056c86e","user":"54aa7f3f9bb00c0b00cb899b","__v":7,"githubsync":"","parentDoc":null,"category":{"_id":"55781fe35129590d003ff4fb","version":"55781fe25129590d003ff4f7","__v":11,"pages":["55781fe45129590d003ff517","55781fe45129590d003ff518","55781fe45129590d003ff519","55781fe45129590d003ff51a","55781fe45129590d003ff51b","55781fe45129590d003ff51c","55781fe45129590d003ff51d","55781fe45129590d003ff51e","55781fe45129590d003ff51f","55781fe45129590d003ff520","55781fe45129590d003ff521","55781fe45129590d003ff522","5579ab5fc7fb3f2100096fad","55f7de1660cc850d008a7a22","55f7e1fbe32e9b0d00a2d4d0","561f72bacec1a50d00979598","561f764f61c0521700acc428","563337539c607719001b85dd","564318f1f49bfa0d002f5566","564f03454f000617007bd670","565ee80a23fd5f0d00a129f9","56793cd73473bc0d008e141b"],"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:43:51.897Z","from_sync":false,"order":3,"slug":"ios-sdk","title":"iOS SDK"},"version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-18T11:23:14.861Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"Please make sure that you're familiar with the [Running the Pulsate SDK](https://pulsate.readme.io/v2.0/docs/running-the-pulsate-sdk) tutorial.\"\n}\n[/block]\nIn addition to the system parameters that Pulsate collects on your customers, you can optionally pass an unlimited amount of of custom parameters as well.  This can be useful for collecting additional data on specific users such as: if they have made a purchase within the app yet, what plan are they on, number of credit points, date of birth etc.\n\nAny custom parameter that you pass to Pulsate automatically appears has a new filter option within the segment builder. Meaning that you can use a combination of our system filters such as *last active* / *number of sessions* combined with custom filters. \n\nSo for example you could build a segment around the following conditions: **Show me users that**: *were active less than 1 week ago* **and where**:* number of purchases is more than 2*. by combining Pulsate's system filter options with dynamic filters (created based on your custom parameters) we can create very granular segments, and thus create highly relevant and targeted campaigns.\n\nWhen you send a custom parameter to Pulsate, you need to let us know what data type it is so that Pulsate knows what segmentation options to present you with. For instance, if you send us a date, we will display options related to that date whereas a for a boolean we will display *true* or *false* as the only segment options. \n\nTo pass a custom parameter with data type simply invoke the following *createAttribute:withValue:* methods on the *PULPulsateManager* object:\n\nString: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[pulsateManager createAttribute::::at:::\\\"Property\\\" withString:@\\\"value\\\"]\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager?.createAttribute(\\\"Property\\\", with: \\\"value\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nFloat: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[pulsateManager createAttribute:@\\\"Property\\\" withFloat:2.0]\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager?.createAttribute(\\\"Property\\\", with: 2.0)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nInteger:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[pulsateManager createAttribute:@\\\"Property\\\" withInteger:2]\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager?.createAttribute(\\\"Property\\\", with: 2)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nBoolean:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[pulsateManager createAttribute:@\\\"Property\\\" withBoolean:YES]\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager?.createAttribute(\\\"Property\\\", withBoolean: true)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nDate\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[pulsateManager createAttribute:@\\\"Property\\\" withDate:[NSDate date]]\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager?.createAttribute(\\\"Property\\\", with: NSDate())\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"passing-custom-parameters-to-pulsate","type":"basic","title":"Passing Custom Parameters to Pulsate"}

Passing Custom Parameters to Pulsate


[block:callout] { "type": "success", "body": "Please make sure that you're familiar with the [Running the Pulsate SDK](https://pulsate.readme.io/v2.0/docs/running-the-pulsate-sdk) tutorial." } [/block] In addition to the system parameters that Pulsate collects on your customers, you can optionally pass an unlimited amount of of custom parameters as well. This can be useful for collecting additional data on specific users such as: if they have made a purchase within the app yet, what plan are they on, number of credit points, date of birth etc. Any custom parameter that you pass to Pulsate automatically appears has a new filter option within the segment builder. Meaning that you can use a combination of our system filters such as *last active* / *number of sessions* combined with custom filters. So for example you could build a segment around the following conditions: **Show me users that**: *were active less than 1 week ago* **and where**:* number of purchases is more than 2*. by combining Pulsate's system filter options with dynamic filters (created based on your custom parameters) we can create very granular segments, and thus create highly relevant and targeted campaigns. When you send a custom parameter to Pulsate, you need to let us know what data type it is so that Pulsate knows what segmentation options to present you with. For instance, if you send us a date, we will display options related to that date whereas a for a boolean we will display *true* or *false* as the only segment options. To pass a custom parameter with data type simply invoke the following *createAttribute:withValue:* methods on the *PULPulsateManager* object: String: [block:code] { "codes": [ { "code": "[pulsateManager createAttribute:@\"Property\" withString:@\"value\"]", "language": "objectivec" } ] } [/block] [block:code] { "codes": [ { "code": "pulsateManager?.createAttribute(\"Property\", with: \"value\")", "language": "swift" } ] } [/block] Float: [block:code] { "codes": [ { "code": "[pulsateManager createAttribute:@\"Property\" withFloat:2.0]", "language": "objectivec" } ] } [/block] [block:code] { "codes": [ { "code": "pulsateManager?.createAttribute(\"Property\", with: 2.0)", "language": "swift" } ] } [/block] Integer: [block:code] { "codes": [ { "code": "[pulsateManager createAttribute:@\"Property\" withInteger:2]", "language": "objectivec" } ] } [/block] [block:code] { "codes": [ { "code": "pulsateManager?.createAttribute(\"Property\", with: 2)", "language": "swift" } ] } [/block] Boolean: [block:code] { "codes": [ { "code": "[pulsateManager createAttribute:@\"Property\" withBoolean:YES]", "language": "objectivec" } ] } [/block] [block:code] { "codes": [ { "code": "pulsateManager?.createAttribute(\"Property\", withBoolean: true)", "language": "swift" } ] } [/block] Date [block:code] { "codes": [ { "code": "[pulsateManager createAttribute:@\"Property\" withDate:[NSDate date]]", "language": "objectivec" } ] } [/block] [block:code] { "codes": [ { "code": "pulsateManager?.createAttribute(\"Property\", with: NSDate())", "language": "swift" } ] } [/block]