In this flow zone, the data included in the [lead_touchpoints](dataset:lead_touchpoints) dataset is prepared in order to be used as an input in the conversion prediction model. 

![Screenshot 2024-01-04 at 10.44.33.png](8z7fYKa1WbN2)

The [window recipe](recipe:compute_lead_touchpoints_windows) retrieves the number of touchpoints per lead along with the first and last touchpoint date associated with each lead id. 

The three pivot recipes ([compute_pivot_by_campaign](recipe:compute_pivot_by_campaign), [compute_pivot_by_optional_cols](recipe:compute_pivot_by_optional_cols), [compute_pivot_by_touchpoint_source](recipe:compute_pivot_by_touchpoint_source)) generate additional columns by categorizing information according to the campaign type, touchpoint source, and any optional columns present in the [lead_touchpoints](dataset:lead_touchpoints) dataset.  By default, the top 20 most frequent values within a column are utilized to form new columns in the pivot recipes. To clarify, each recipe has the capacity to produce a maximum of 20 new columns using the default configuration. That value can easily be updated by manually changing the parameters in the recipes. 

The [prepare recipe](recipe:compute_touchpoints_period) followed by the [group by recipe](recipe:compute_touchpoints_period_by_lead_id) computes the touchpoint period and the total count of touchpoints per lead.  