Introduction
Webpushr lets you augment user information by defining additional custom attributes from your internal CRM system. You can use custom attributes to store information such as the projects your users work on, their physical locations, their hire date, a custom user ID, Email Address, or whatever else fits your business needs. Once you start associating custom attributes, you can then use these attributes as filters to send targeted web push notifications.
Once you know what attributes you want to set for your users, simply call the _webpushrScriptReady
function anywhere on the page.
<script>
function _webpushrScriptReady(){
webpushr('attributes',{"key1" : "value", "key2" : "value" });
}
</script>
Info | Type | Length | Description |
---|---|---|---|
key |
string | 50 | The name of the custom attribute such as Age, Gender, Hire Date, User ID, E-mail, etc. |
value |
string | 100 | The value of the custom attribute. |
Sample Custom Attributes Code
In order to save Gender, User ID & E-mail for a user, add the following code anywhere on the web page:
<script>
function _webpushrScriptReady(){
webpushr('attributes',{"Gender" : "Female", "User ID" : "874", "E-mail" : "name@example.com"});
}
</script>
You can also pass Custom Attribute information inside our main javascript snippet, as shown below:
<script>
**Our JS snippet goes here**
webpushr('attributes',{"Gender" : "Female", "User ID" : "874", "E-mail" : "name@example.com"});
</script>
Why set custom attributes?
Custom attributes enable you to send highly targeted push notifications. There are basically two methods of using Custom Attributes to send push notifications:
- First method is a two-step process and entails using our powerful segmentation feature to first create a dynamic segment based on custom attributes. Once a segment is created using our web console, you can then move on to the second step and send push notifications to the segment either via our Web Console or programmatically using our API endpoint for segments.
- The second method is a one-step process that lets you programmatically send push notifictions using our API for push to custom attribute(s).
How to update custom attributes
Simply pass the new value for a custom attribute using our javascript function in order to update the old value. We do not keep two values for the same attribute for any single user. Example: Only one value for a single key such as "Email" is stored, per user. Any time you pass a new value for "Email" for a particular user, we override the previously saved value if there is any.
Limitations
Custom attributes are browser specific, as are subscription end-points, and not user specific per se.
How to test and validate Custom Attributes
You can track Custom Attributes under "Logs" section of the dashboard.
- Got any questions? Ask the Webpushr Forum New