Creating Attributes
In addition to the system attributes that Pulsate collects on your customers, you can optionally pass an unlimited amount of of custom attributes 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 they are on, free / paid etc.
Any custom attribute 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 last 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 attribute 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 set a custom property simply invoke the createAttribute:withValue method:
String:
[pulsateManager createAttribute:@"Property" withString:@"value"]
pulsateManager?.createAttribute("Property", with: "value")
Float:
[pulsateManager createAttribute:@"Property" withFloat:2.0]
pulsateManager?.createAttribute("Property", with: 2.0)
Integer:
[pulsateManager createAttribute:@"Property" withInteger:2]
pulsateManager?.createAttribute("Property", with: 2)
Boolean:
[pulsateManager createAttribute:@"Property" withBoolean:YES]
pulsateManager?.createAttribute("Property", withBoolean: true)
Date - the format of the Date that is sent to the server is - yyyy-MM-dd HH:mm:ss, the timezone is UTC.
[pulsateManager createAttribute:@"Property" withDate:[NSDate date]]
pulsateManager?.createAttribute("Property", with: NSDate())
Incrementing / Decrementing Custom Attributes
We also give you the ability to increment / decrement custom attributes.
This is useful in situations where you want to increase / decrease a value without knowing it's current value.
Incrementing:
[pulsateManager incrementIntegerAttribute:@"number_of_transactions" withInteger:1]
pulsateManager.incrementIntegerAttribute("number_of_transactions", withInteger: 1)
This will increment the counter named clickCounter by 1. If the counter will be incremented for the first time, it will be created and initialized with 0 value, then incremented by 1.
Increment value can be positive as well as negative. If a negative value is given i.e. -1, it will act as decrement by 1.
Decrementing:
[pulsateManager decrementIntegerAttribute:@"number_of_transactions" withInteger:1]
pulsateManager.decrementIntegerAttribute("number_of_transactions", withInteger: 1)
Will decrement counter named clickCounter by 2, if counter is decremented for the first time, it will be created and initialized with 0 value, then decremented by 2.
Decrement value can be positive as well as negative. If negative value is given i.e. -1, it will act as increment by 1.