How to: Retargeting Facebook Ads Based on Drift EventsLast Updated: December 18, 2018
What can you do with Facebook and Drift?
There are two main use cases:
Create different audiences for retargeting ad campaigns.
- ex: "someone chats in on my website, now I want to hit them with ads"
Use Drift events as conversion goals for normal ad campaigns.
- ex: "I am targeting marketers in Boston with ads and my campaign goal is to book a meeting through Drift"
For this Tutorial, we're 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.
- Starts a Conversation
- Captures an Email
- 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.
- Make sure the Facebook pixel script is already installed. You can do it using the Facebook Pixel Helper
- 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.
- Open the pixel manager in Facebook Ads.
- Click 'Create New Audience'.
- Click 'All Website Visitors' and select the newly created events from the list.
- Specify a time window for when the event occurred.