Custom meta data

Besides the default meta data it is also possible to use custom meta data.

An example could be that you want to define the following variables for a user:

  • Age
  • Shoe size
  • Gender
  • customerID

To make use of these variables and make sure they are linked to userData, you will have to create these new variables in the Harvest Console.

After you have created these variables, you can use them, by adding the information as meta data in the tracking code. This is what we call the datalayer.

For more information about what the datalayer is, read our datalayer documentation.

harvest.trackEvent({
    "event":"pageview",
    "data": {
        "isLoggedIn": "1",
        "age": 16,
        "gender": "1",
        "customerID": "123563"
    }
});

The above example is a pageview for a user that was logged in (isLoggedIn = “1”). The user has an age of 16 and a gender of “1”. Which means he is a male according to the ISO 5218 standard. We have also identified the customerID of the user. This ID could be used to stitch users together across devices and platforms.

Query string parameter

Besides putting data in the datalayer. It is also possible that data will be available in the query string parameters. We made it possible to easily links variables to query string parameters. If the query string is populated, Harvest will hen automatically put the information in the corresponding variable.

For more information, read our query string parameter documentation.