Follow

Tracking custom variables in People Profiles

A profile is created for every visitor on your site, that can later be used to segment or filter data collected by your website surveys.

This profile can be added to using a global Javascript variable placed above the MARE Javascript snippet.

The variable must be an object that includes the custom variables and the values you want to have added.

Here is an example:

      custom_example: 'example'
    };
 
In the above example, the email address [email protected]' would be added to the user's profile, and a custom variable 'custom_example' would have the value 'example'.

Custom variables are split into two types:

User level variables

These variables will be assigned to the user profile itself, and will be overwritten if a new value is used in a future user session. These are used for things like email, user ids, or other values that will generally stay with a user such as 'created date'.

User-level variables are defined by using a dollar sign at the beginning of the variable name. Example:

var _mare_v = {
    $email: [email protected]'
}

Session variables

These variables will be assigned to the user's session, and will not be overwritten if a different value is used in a future user session. These variables are used for things like campaign ids, affiliate ids or other values that you want to assign to a set of actions that a user takes instead of the user itself.

Session variables use no pre-fix on the variable name. Example:

var _mare_v = {
    'affiliate id': 1234
}

Using dynamic variables

In most cases, you will want the variables sent to MARE to be dynamic based on the user. You can do this using an existing Javascript variable like so:

var _mare_v = {
    $email: my_email_variable
}

Or using a server side language like PHP:

var _mare_v = {
    $email: '<?php echo $user_email; ?>'
}

Installing the code on your site

To install the variable code, you must define the variable anywhere above the MARE tracking snippet. Once installed, MARE will begin assigning the custom variables to your user's profiles right away.

Please note that this feature is a MARE Insights feature, and will require an active MARE Insights subscription to work correctly.

0 Comments

Please sign in to leave a comment.
Powered by Zendesk