How to: Retargeting Facebook Ads Based on Drift Events

by Jason Li

What can you do with Facebook and Drift?

There are two main use cases:

  1. Create different audiences for retargeting ad campaigns.
    1. ex: "someone chats in on my website, now I want to hit them with ads"
  2. Use Drift events as conversion goals for normal ad campaigns.
    1. ex: "I am targeting marketers in Boston with ads and my campaign goal is to book a meeting through Drift"

For this Tutorial, I'm going to focus on #1.

What events can you target?

Using the Drift Widget API, we can listen for the following events and pass them to Facebook.

  1. Starts a Conversation
  2. Captures an Email
  3. Schedule a Meeting

More advanced integrations can be done too, although they would probably involve our SDK.

What's the Process Look Like?

This assume the customer already has the general Facebook script added to their site.

  1. Make sure the Facebook pixel script is already installed. You can do it using the Facebook Pixel Helper
  2. Send the Drift Events outlined above to Facebook by adding a Javascript snippet to the customer's website.
  3. Create custom Facebook audiences based on the events in step 1.

Part Two - The Script:

The script below only deals with creating custom Drift audiences for Facebook ads. To create Drift events as Facebook ad conversion goals, we would need to alter the script to use standard Facebook events. See here. Place the minified version of this script in the footer.





Part Two - Check Your Work:

After loading the script on the customers site, open the Chrome console. Now, walk through a typical drift chat (start a chat, give a test email, and book a meeting if applicable). In the console, you'll see 'Chat Started', 'Email Captured' and 'Meeting Booked'. This means that we are successfully binding to the Drift events.

Now, open then network tab. If you do a search on 'facebook', you should see the events being passed to Facebook and returning 200. Note, you can see the encoded event text in the Name.

Part Three - Create the Facebook Audiences

If the events haven't shown up in Facebook yet, don't panic. Facebook updates the event history hourly.  Once the events show up, you can build a custom audience.

  1. Open the pixel manager in Facebook Ads.
  2. Click 'Create New Audience'.
  3. Click 'All Website Visitors' and select the newly created events from the list. Specify a time window for when the event occurred.

Part Four - Profit

Was this article helpful?