Site Tracking - Extra Functions
Once the code is deployed on your site, you can also call the following functions to push extra data into the tracking system as follows...
Variables you can Pass
mpEmailAddress | The email address |
mpGroupId | The id of the group you would like new email addresses sent to. If not set, un-recognised addresses will be ignored. |
mpPath | The current path on your website. |
mpQuery | The current querystring on your website |
mpCustomFields | An object containing any custom field values you would like to send in. You can send anything in here, we will auto create the fields if they don't exist. We will even attempt to auto detect the type of data you are pushing in! |
Inline
You can pass variables by simply initiating/updating them anywhere on your page like this...
<script>
var mpEmailAddress = "test@test.com";
var mpGroupId = 74175;
var mpPath = "/path.html"
var mpQuery = "?query=1"
var mpCustomFields = {
"First Name": "Colin",
"Age": 19,
"Birthdate": new Date("2015-03-25").toISOString(),
"Male: true
}
</script>
Programatically
You can force the variables to update by programatically calling a function like this...
<script>
manualTracking(
mpPath,
mpQuery,
mpEmailAddress,
mpCustomFields,
mpGroupId
)
</script>