MadKudu Docs


Setting up MadKudu Facebook ad spend optimizer


MadKudu Facebook Optimizer enables you send the predicted value of each lead back to facebook in order to train the bidding algorithm.
You can read here how MadKudu Fastlane increased Drift’s facebook ROI by 3x


In order to run MadKudu Facebook Optimizer on your lead forms you will need:

  • MadKudu Fastlane enabled for your account (contact support or your account manager to activate the feature)
  • MadKudu snippet installed on your demo page (see instructions)
  • Facebook pixel is live on your page
  • 50+ daily lead captures originating from facebook ads
  • MadKudu Predicted Value enabled for your API key (contact support or your account manager to activate the feature)

How to set up MadKudu Facebook Optimizer

As always, you can contact support or your account manager for further assistance

It takes a few clicks to set it up.

1. Log into your MadKudu account, go to the “Campaigns” section, and create a new Campaign.

2. Edit the campaign name.

Name your campaign according to the landing page the Fastlane will be implemented on.

eg. "Conversion eBook - Facebook optimizer"

3. Configure the MadKudu Form

1 Input the URL of the page in the URL field

2 Configure your Form

Define the email field to track for qualification
In the code snipped below, replace ‘#email’ with the email field identifier on your form.

var email = '#email';

In the section, “what to do when a lead is qualified”, add the following code

// get all computed attributes from MadKudu
var traits = madkudu.user().traits();
// get the predicted lead value
var mk_value = traits.predicted_value
// send the predicted value back to facebook as a conversion
var call = {currency: "USD", value: mk_value };
fbq('track', 'Purchase', call);

3 Configure a webhook (optional)

If you’d like to have a webhook to fire whenever a qualified prospect is identified, you can add a webhook to your form

NB: The first webhook fires whenever a lead is qualified, the second fires only when a fastlane CTA is available and clicked.

4 Test your Fastlane

Use the preview functionality to test the Fastlane functionality.
Warning, while using Fastlane in preview mode does not impact your production forms, you will nonetheless be sending data to your facebook pixel.

5 Publish

Once you’re satisfied with the preview, turn the form on and publish it.
After a couple minutes you can check that the form is live by heading to your demo request page and running the following command in the console:


It should return true indicating the form is now live and ready to qualify prospects.

6 Upgrade your facebook bidding

After a day or two of having the campaign live, a new bidding option will appear in your facebook console:

7 Sit back and enjoy AI training AI for better performance!