Reamaze Data Integration

Data Integration with Reamaze allows you to send us user data for segmentation purposes. Please refer to the following sections, depending on how you've chosen to integrate with Reamaze:

JavaScript

To start tracking with Javascript, paste the following code into the page you want to track inside the <head> and </head> tags. We load the library onto the page asynchronously, which won't affect the load time of the page even if placed in the <head> of the page. Optionally, you may also place the snippet at the bottom of the document, just before the </body> tag.

User Data

  <script type="text/javascript">
   var _support = {
     account: 'YOUR_ACCOUNT_ID',
     id: 'USER_ID',
     authkey: 'AUTH_KEY',
     email: 'USER_EMAIL',
     name: 'USER_NAME',
     avatar: 'USER_AVATAR_URL',
     created: 'USER_CREATE_TIME',
     data: {
       key: value,
       key: value,
       key: value
     }
   };

   (function() {
     function async_load() {
       var s = document.createElement('script');
       s.type = 'text/javascript'; s.async = true;
       s.src = '//cdn.reamaze.com/assets/reamaze.js';
       var x = document.getElementsByTagName('script')[0];
       x.parentNode.insertBefore(s, x);
     }
     if (window.attachEvent) {
       window.attachEvent('onload', async_load);
     } else {
       window.addEventListener('load', async_load, false);
     }
   })();
  </script>
  

Required Values

account, id, authkey, and email are required fields to identify the user. All other fields are optional.

Optional Values

Custom Data

You may send us additional custom user data for segmentation in the data hash. You may define this however you want as key/value pairs.

Reamaze Events API

Events can be triggered via a JavaScript function call. Events have a name and a value. Values should present monetary or other numeric amount that can is automatically summed to calculate the user's total lifetime value.

The data hash allows you to describe an event with custom key/value pairs.

  <script type="text/javascript">
    reamaze.event({
      name: 'EVENT_NAME',
      value: EVENT_VALUE,
      data: {
        key: value,
        key: value,
        key: value
      }
    }
  </script>
  

Raw JSON

You can send user and event data to Reamaze via Raw JSON instead of or in addition to the JavaScript integration.

Authentication

Reamaze API access is available only through SSL/HTTPS. All authentication is performed via HTTP Basic Auth.

The HTTP Basic Auth user should be your account API key and the password should be left blank.

User Data

https://{YOUR_ACCOUNT_ID}.reamaze.com/data/users

User data can be sent by POSTing a user object to the above URL

Required Values

id, authkey, and email are required fields to identify the user. All other fields are optional.

Optional Values

Custom Data

You may send us additional custom user data for segmentation as a data hash. You may define this however you want as key/value pairs.

Event Data

https://{YOUR_ACCOUNT_ID}.reamaze.com/data/events

Event data can be sent by POSTing user and event objects to the above URL

Required Values

id and authkeyare required fields to identify the user. name is required to identify the event. All other fields are optional.

Optional Values

Examples

A couple of examples are provided below using curl.

Example user POST:

curl https://{your_account}.reamaze.com/data/users
     -H "Content-type: application/json"
     -X POST
     -d '{"user":{"id": "1", "email": "bob@example.com", "authkey": "xxxxxx", "data":{"foo":"bar"}}}'
  

Example event POST:

curl https://{your_account}.reamaze.com/data/events
     -H "Content-type: application/json"
     -X POST
     -d '{"user":{"id": "1", "authkey": "xxxxxx"}, "event":{"name": "purchase", "data":{"foo":"bar"}}}'
  

Questions?

Email us at