Sending Betaout custom user data

You can easily send custom properties of users and events done by the user

You have to send dates in unix timestamp format and all properties names should end with “_date”
for e.g. birth_date, Signup_date, paid-Plan-Subscribe_date etc

 

 

Javascript Samples below.

 

– You can send name and email address of your signed-in users to identify them. Email address is used to identify different users.

_bOut.push(["identify",{
            email: "bill@gates.com",
            name: "Bill Gates" 
          }])

 

 

– You can register events by calling them

_bOut.push(["addEvent",'email','eventName']);
_bOut.push(["addEvent",'bill@gates.com',{ 'eventName':  { 'time':'unix_timestamp}  }]);
//Time should be in unix time.

 

 

 

– You can send custom properties for users. ‘Update’ will replace old values (if present) of these properties

  _bOut.push(["update",'bill@gates.com', {
         "plan_type": 'gold plan',
         "propertyName": 'propertyValue',
         "property2Name": 'property2Value',
         "purchase_date": '4364763483'
   }]);

Note: You have to send dates in unix timestamp format and all properties names should end with “_date”
for e.g. birth_date, Signup_date, paid-Plan-Subscribe_date etc

 

‘Add’ will add (if numbers) or append (if text) values of the properties.

_bOut.push(["add",'bill@gates.com', {
           "Revenue": '1000',
           "propertyName": 'propertyValue',
           "property2Name": 'property2Value'
 	});

 


 

– Complete Sample Code

 

<!-- Start of Betaout Code -->
var _bOut = _bOut || [];
var _bOutAKEY = "API_KEY", _bOutPID = "PROJECT_ID", _bOutCW = true, _bOutST = true;
function _bOutS(u) {
  var d = document, f = d.getElementsByTagName("script")[0], _sc = d.createElement("script");
  _sc.type = "text/javascript";
  _sc.async = true;
  _sc.src = u;
  f.parentNode.insertBefore(_sc, f);
 }
_bOutS('//d22vyp49cxb9py.cloudfront.net/jal.min.js');
_bOut.push(["identify", {
                    "email": "",
                    "name": ""
                }]);
/* ------
You can identify user through Amplify.identify function
------ */

_bOut.push(["identify", {
             "email": "bill@gates.com",
             "name": "Bill Gates"
          }]);

/* ------
You can use _bOut.push(["addEvent","EMAIL","EVENT_NAME"]) for registering an event for the user
------ */
_bOut.push(["addEvent","email",'eventName']);
_bOut.push(["addEvent","bill@gates.com",{ 'eventName': { 'time':'unix_timestamp} }]);
//Time should be in unix time.

/* ------
You can use _bOut.push(["update","EMAIL","EVENT_NAME"]) for updating user properties. Any old value of the property will be replaced with new value
------ */

_bOut.push(["update",'bill@gates.com',{
            "plan_type": 'free',
            "propertyName": 'propertyValue',
            "property2Name": 'property2Value'
}]);

/* ------
You can use Amplify.add() for adding or appending user properties. Numbers are added while strings are appended
------ */
_bOut.push(["add",'bill@gates.com',{
            "Revenue": '100',
            "propertyName": 'propertyValue',
            "property2Name": 'property2Value'
}]);

};
<!-- End of Betaout Code  -->

Feel free to ping us or drop a line if you face any problems integrating Betaout.