How to create a Facebook custom audience from Shopify
Learn how to create Facebook and Instagram advertising audiences based on customer data in your data warehouse. These audiences are a great way to increase the value of existing customers, re-engage dormant customers, and release new products.
Overview
Facebook custom audiences are great for retargeting and creating lookalikes of your best customers, but updating them manually is unsustainable. You could create audiences based on the pixel on your website instead, but that has a number of limitations like:
- Missing data from ad blockers, GDPR/CCPA opt outs and Incognito mode, unless you also implement the Facebook Conversions API.
- Cookie-based audiences can only look back a up to 180 days, but you may want to retarget customers from prior years.
- It can't apply advanced logic, such as âI want customers who have spent $50 in this category, and $300 overall'.
This recipe will show you how to you create audiences based on customer data in your data warehouse. For the purposes of this example, we'll use standard fields exactly how they'e brought in by the Fivetran Shopify connector. Unless you're using Shopify and Fivetran, you're data will look different but this should still be relevant with a few tweaks to match the terminology in your orders, products, and customers tables. If you know a bit of SQL or can borrow a data team member's time for even a few minutes, you should be up and running with Facebook Custom Audiences in no time!
This recipe lets you filter on the following parameters:
- Specific kinds of products: their title, handle (ie yourstore.com/products/handle), vendor, and type.
- How recently the customer made an order in that product/type.
- How much the customer spent on the specific product/type.
- How much the customer has spent on your store in general.
- Whether your customer accepts e-mail marketing.
Use Case
The Facebook Marketing API is very particular about how it wants to receive customer data. Your data will need some transformations so that everything is lowercase and stripped of special characters. It's best practice to create a view of your Customers table that transforms.
When you do this yourself, your imagination should be your guide as to what dimensions you use to define your audience and what criteria you use to segment them. With Census you can easily create multiple audiences based on a single base audience with Census Segments.
Let's make an audiences!
This transformation does three things
- Joins orders to line items to products and pulls in customers who have ordered specific kinds of products.
- Joins customers to addresses, hashing PII to make your legal team happy and cleaning city names to make the Facebook API happy. They want São Paulo to be saopaulo.
- Selects a final list of customers who meet a minimum threshold of spend in the target products as well as total spend across all products on your store.