Real-Time Website Visitor Conversion Prediction

When searching tools to optimize our product pages’ conversion rate at Grew, I couldn’t find a solution that is easy to implement, privacy-friendly, and that would allow us to personalize our front-end based on user behavior automatically. To achieve this I have started to implement a machine learning based solution that uses event data (eg. time on page, bounce, link click, subscription, conversion, signup) and device related data (eg. device type, browser, time zone) to build a real-time conversion prediction system.

My goal is to keep the system safe and light by using only non-personal and non-sensitive data and not use cookies. The central hypothesis is that when we have collected enough data, our model can create segments and audiences based on the input data for creating a prediction model that can identify in real-time during a website session the likelihood a visitor will convert.

Currently, the client-side package consists of two parts:

  1. A script that tracks and sends the website visitors’ device and event data to a tracking API. By default, the script tracks bounce and click events and device-data, but I can pass any events using a simple function.
  2. A script that calls the prediction API, which returns the predicted action the user will take. The data also predicts how many seconds after the pageload the user will do the predicted action.

If you are interested, all the client-side scripts are in use in this Github repo.

On the back-end, I use brain.js neural network that categorizes the event and device data it gets from the 1st tracking API. The output is a prediction model that serves the action and timing predictions to the 2nd prediction API. We upload the trained neural networks to a mongoose database.

Testing in production

Alternative, you can try the solution here.

Next steps

Co-Founder @Grew Creator of pointNG.io, ConsoleChat.io