Custom processing

After Harvest Collect has performed the enrichment process, it is possible to execute some code to manipulate the data object.

Basics

Custom processing is simply a function with the following basic format:

function(event){

        return event;
}

This means that the data object will be inserted into the function and you will have to return the event as well.

Important: You yourself are responsible for writing valid Javascript. If you do invalid manipulations to the event-object, this might result in breaking Harvest Collect.

How to make use of this feature?

As mentioned, the custom processing script is used after all enrichments have been completed, but before the tools are evaluated.

So if you want to make some adjustments to the final event before it is being processed by the tools, then you can use custom processing for it.

One of the use cases is that you might want to add some extra data on the fly that is not sent with the event. Another use case might be that you want to manipulate some variables. For example you want to create a new variable for your products, which is a concatenation of the product name and category.

There can be numerous use cases, but the important thing to know is that this script is processed after other enrichments and before the tools are evaluated.