Introduction

Webpushr lets you augment user information by defining additional custom attributes. 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 such.

Sample Custom Attributes Code

In order to save Gender, User ID & E-mail, you can add the following code anywhere on the 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:

  • Augment user data with more detailed information (possibly from an existing CRM system).
  • Send highly targeted push notifications. Our powerful segmentation feature can be used to create audience groups based on custom attributes. This consequently lets you send push notifications to a specific segment. Example: if you want to send push notification based on users’ age group & gender, you can do that using custom attributes.

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.