data-track-change

When a user fills out a form, we are often interested in what the user filled in.

We can track this change with the following code:

<input type="text" data-track-change='{
    "variableName": "email"
}' />

The code above will trigger when the input field is changed. It will then automatically grab the value from the input form and put it into the variable with the name specified in the property “variableName”.

Note that if you do not provide the “variableName” that only the change will be tracked, but not the value. This is due to privacy risks.

Let’s say you fill in the value “test@test.nl”, then this will create the following call to Harvest behind the scenes:

harvest.trackEvent({
        "event":"change",
        "data": {
                "variableName":"email",
                "elementValue":"test@test.nl"
        }
});

E-mail is a default userData meta data variable, so this will lead to:

{
        "userData": {
    "email": "test@test.nl"
}
}

Of course, the above is only a part of userData.

hashedEmail

In Harvest Console we have built in functionality to generate as hashedEmail for email-addresses. This way you can use the hashed version in tooling instead of the plain text variant.

If you want to control your own input form changes, you can also use our Javascript API.

Privacy

Users can fill in sensitive information. That is why we do not track this data generically. You will have to provide the variableName. The data the user filled in, will then be transferred to the variable provided.

You yourself are then responsible for blacklisting variables when the user did not give any consent. Read the variable blacklisting documentation for more information.