How to Use Facebook’s Dynamic Ads For Quality Blog Traffic
Blog
Facebook

How to Use Facebook’s Dynamic Ads For Quality Blog Traffic

Michael TaylorMichael Taylor

July 15, 2021

You went to a lot of effort to design your blog and write each blog post, but how much time have you put into promoting it? Sure it’s going out in your email newsletter, you shared it a few times on Twitter and Reddit, but how do you get traffic from people who’ve never heard of you?

One quick trick to seed that initial audience is to promote your posts on Facebook. If you’re thinking it’s crazy to run paid ads to promote free content, hear me out. Most never do this, but if you add up all the time spent on that post, and multiply it by your hourly rate, I bet it’s costing you in the order of $500 – $1,000 per article!

If you’re already spending thousands of dollars making that ‘free’ content, doesn’t it make sense to spend another $20-$30 a day to make sure it does well? Google isn’t in the habit of ranking websites with no traffic, and nobody can share your post if they don’t see it first, so spending on paid promotion can be just what you need to kickstart your blog’s growth.

The best way I’ve found to do this is to re-engineer Facebook’s Dynamic Product Ads (DPAs). Once set up, it becomes an evergreen campaign that is always running in the background, generating new ads and promoting your posts automatically. Even better, you can set it to optimize to people who actually read your content, so you know that traffic is valuable and none of your budget is wasted. Pretty awesome growth tactic right?

The setup for Dynamic Product Ads is advanced — you can’t just copy and paste a pixel on your site and call it a day. You have to set up a product feed of blog posts and connect your tracking so that Facebook can dynamically match the product feed to website behavior. But don’t worry, this guide covers all you need end-to-end to get your campaigns running.

*Note: I’m covering the setup for Webflow because that’s what my Facebook creative blogThe Swipefile is built on, but the principles remain the same regardless of what CMS you use.

Creating Your Dynamic Ads “Product” Feed

The first thing you need is a list of products to promote. These ads were designed to promote a list of products for eCommerce sites, so we’re just adapting the format a little to make our blog posts our ‘products’. This canbe a programmaticallyupdated database or something as simple as a spreadsheet, and it’s that section option we’ll explore today.

This is what it’ll look like when you’re finished:

product feed - blog post version

This spreadsheet is important because it’s where Facebook will pull all of the information you want to insert in your ads. It will go through and make one (or multiple) ads for each row in the spreadsheet, dynamically generating it based on the data in the columns fed through a template you create.

To get started, first download the standard CSV template here:https://developers.facebook.com/docs/marketing-api/catalog-feed-setup#csv-feed-format

dpa product catalog example

Then you need to export all of your blog posts from your CMS. In our case for Webflow that’s easy — in the CMS Collections section there’s a handy Export button on the top right.

webflow cms

I find it easiest to just copy and paste from the Excel spreadsheet Webflow gives me, into the right column in the Google sheet. You can see that I’m pasting the column headers from the Excel directly in the column, so I can see where the template ends and my data begins. We’ll be deleting that after once everything is lined up.

swipefile dpa product catalog feed

Each blog post has to have a unique ID (we’ll get to that later in the tracking setup). For the condition make sure you put ‘new’, and availability ‘in stock’. You have to put a price, but no need to put this into the ad.

product catalog unique ids

You can add your own custom labels with the naming convention custom_label_0, custom_label_1, for any fields like Author, or Tags that you want to be able to filter by or insert into the ad.

product catalog labels

When you’re finished just delete any data or columns you didn’t use, including the template data, and you should be left with something that looks like this:

https://docs.google.com/spreadsheets/d/16Qg9zNj6V4cl9MSsRTIyqg7y4UAWNJ9og0laAUktaSU/edit?usp=sharing

product catalog template data

Once you’re ready, you can actually publish that spreadsheet to the web to use as a dynamic product feed. Any changes to the spreadsheet, for example if you add more rows when you publish new blog posts, will be pulled from your publish link directly into Facebook, once they’re connected. The ‘Publish to the web’ option is under the File menu.

google sheets publish to web

You want to publish as Comma-separated values (.csv), and copy the link you get so you can paste it into Facebook later on. Anyone with this link can access the list of products here, so make sure you don’t share it widely or submit any sensitive information.

publish as csv

Ok, that part is done — you published a product feed! Now you just need to set it up as a catalog in the Facebook platform. To do this, log into your ads manager and go to the menu > Assets > Catalogs > then click Create catalog (orvisit this URL).

navigate to facebook catalogs

You want to choose Ecommerce, then Upload Product Info, and give your Catalog a name. Now View the Catalog, and go to Configure > Product Data Sources > Use Data Feeds.

facebook product feed upload

Finally, you’re at the point where you can paste that link Google Sheets gave you when you published to the web. It goes right there in the ‘Data Feed URL’ section after you select “Set Automatic File Upload Schedule”.

Facebook will then import your products from your sheet, and tell you if you have any errors. Hopefully though because it’s a relatively simple spreadsheet it should pass the first time with all products (blog posts) uploaded. If it doesn’t, just pay attention to what the errors are telling you and make any necessary changes.

facebook product data sources

You can see all of your products and filter them by different attributes in the Products section of the Catalog. This is also where you make Product Sets if you want to advertise some products separately or segment them out into separate campaigns.

facebook product sets preview

To check your upload worked correctly, just click into a couple of these products and make sure you have the right images, titles, etc all present.

facebook product upload preview

You don’t need to overcomplicate at this stage — it can be tempting to go back and edit your feed to include more and more information, but for now, let’s focus on just getting a basic setup live. We can always go back later once we see this working to experiment with more advanced functionality. So long as you have the image, title and URL, you’re good to go.

One final thing before you leave: make sure you go to “Events Data Sources” and click Connect to Tracking. If you don’t yet have a pixel set up you might have to follow the next section and come back to it.

Setting Up The Facebook Website Code For Dynamic Ads

If you completed the last section, Facebook knows what blog posts to expect on your website. What it doesn’t know yet is which users are visiting those posts, how many times they visit or any other valuable user behavior that might be useful for optimization. To be able to give Facebook that information, we need toset up trackingon our website.

First navigate to Menu > Measure & Report > Events Manager > Pixels in your Facebook ads manager. This is where your unique pixel lives for your account, which you’re going to copy and paste across to your CMS.

navigate to facebook pixels

If you go to the top right you’ll see a dropdown for ‘Set Up’, and you want to click ‘Install Pixel’. Then you want to choose manually add pixel code to the website (you don’t need a developer, you’ve got this guide!). From there you’ll see a block of code to copy and paste into the header section of your website, just above the </head> tag. For Webflow however, all we need is that number ID in the line “fbq(‘init’, ‘841205239359329’)”.

facebook pixel code

Now if you log into Webflow and go to your project’s settings > Integrations then scroll down, you should see a section for the Facebook pixel. All you need to do is paste your pixel ID (from that ‘init’ line) into here and Webflow will install the rest of the base pixel for you!

facebook pixel id

Now for the difficult part — adding dynamic code to your website. Back when we were setting up the Product Feed I mentioned that each post needs its own unique id. Well Webflow remarkablydoesn’tactuallyhavethatfunctionality, so we need to make one.

Thankfully in Webflow, it’s pretty easy to add new fields to the CMS, so click into your CMS Collections > Posts (or whatever model deals with blog posts) and add a Number field. Call it Dynamic ID, set the Minimum number to 0 and make the field required.

webflow dynamic content settings

Now if you go into each blog post, you need to enter a unique ID into each field. I know I know, Webflow should be able to do it for you, but for now, you’re going to have to do it manually. You want to make sure this matches exactly with what you entered into the spreadsheet for your Product Feed (or export the blog posts only after you do this step).

webflow dynamic content ids

Great, now for the fun part! Webflow makes it easy to insert dynamic code into your website, you just need to know how. First, you need to go to your template for Posts and add a code snippet in the footer.

webflow page editor

If you click the + sign to add an element, then scroll down to Components > Embed, you’ll be able to drag it into place. Note you should set the Height of the embed as 0px.

embedding in webflow

Ok, time to place the dynamic code in the HTML embed. All this does is tell Facebook the name, value, currency, ID, and type of product that’s being shown on the page. You can copy and paste the snippet here, just make sure you click +Add Field to replace the <Name> and <Dynamic ID> part. Take care not to delete any quotation marks, commas or brackets — those things are important!

<script>

fbq(‘track’, ‘ViewContent’, {

Content_name: “<Name>”,
value: 1,

currency: ‘GBP’,

content_ids: [‘<Dynamic Id>’],

content_type: ‘product’,

});

</script>

html embed code editor

Now if you save and publish, you’ll have associated user behavior on your website to products in your feed. Facebook will know how many people are visiting each product, and therefore who to target or retarget. You can test your setup by downloading theFacebook pixel helper.

facebook pixel helper

You can see the name and ID have passed through successfully by clicking the Facebook pixel helper Chrome extension icon on a few of your blog posts and checking it all matches what you put in the product feed. You should also be able to see your live events come through back in the Pixel section of the Facebook ads manager.

content parameters

This is all you need for a basic setup if you want to promote your blog posts and drive traffic, but let’s go one step deeper. You don’t just want traffic, you want readers — people who actually read your blog posts (you can’t build a business on fake bot traffic or people who just land and bounce without reading).

So let’s set up the ‘Purchase’ event to trigger for people who read at least 50% of the article usingthis methodfrom W3Schools. I’ve modified the code for you, so you just need to go back to your embed editor and paste in the following:

var depthHit = 0;

window.onscroll = function() {trackScroll()};

function trackScroll() {

var winScroll = document.body.scrollTop || document.documentElement.scrollTop;

var height = document.documentElement.scrollHeight – document.documentElement.clientHeight;

var scrolled = (winScroll / height) * 100;

if(scrolled>50 && depthHit==0) {

depthHit = 1

console.log(“Scrolled 50%!”);

fbq(‘track’, ‘Purchase’, {

value: 50.00,

currency: ‘GBP’,

content_ids: [‘<Dynamic ID>’],

content_type: ‘product’,

});

};

};

dynamic id in embed code

Remember again to click on +Add Field to replace the <Dynamic ID> part, and be careful not to modify any of the commas, quotes or brackets.

This code tracks the distance from the bottom of the screen the user has scrolled to, then as soon as they scroll past 50% it flips a switch and fires the Purchase event. You can easily modify this to fire at 25%, 75% or even 100% by changing the “if(scrolled>50 && “ part of the code. Test that it is working with the pixel helper, and you’re now fully integrated, finally ready to set up your campaign!

Setting Up Dynamic Ad Campaigns For Your Blog Posts

Congratulations! If you made it this far it means you successfully built a product feed and set up some pretty advanced dynamic tracking. Now for the easy part to finish; building your campaigns. This is the part that makes everything worthwhile.

Assuming you connected your Catalog to Tracking in the Events Data Sources section of your Catalog, you should be good to go. To start, go to your ads manager and create a ‘Catalog sales’ campaign.

facebook dynamic product ads campaign set up

Now name your campaign and make sure the right catalog is chosen. You don’t want to be constantly messing with optimizations and Facebook does a better job at this than you would, so I recommend you choose Campaign Budget Optimization and set a daily budget. You don’t need to start big, but $20 a day is $608 a month which is enough to get things going, and you can choose to scale up or down from there.

facebook campaign settings

I recommend making two ad sets within your campaign, one for retargeting (people who have been to your website and not ‘purchased’ or read 50% of your blog posts), and one for prospecting (people who have not been to your website yet). Here’s how it looks for retargeting:

facebook ad set creation

There are many different audience targeting options but let’s keep it simple to start and expand as we go. For retargeting I recommend just choosing someone who has been to your website in the past 14 days. You don’t want to chase them around the web forever if they’re not interested.

facebook ad set targeting

For prospecting, I recommendcreating a lookalike audienceof people who have been to your website. If you select Find Prospective Customers and then go to Create New under custom audiences, select Website traffic, you can create your custom audience. Then you just need to create a 1% lookalike by selecting that custom audience. Note my traffic in countries outside the US wasn’t big enough to create a lookalike, so I stuck with the US on this one.

lookalike audience

This is important: as you scroll down to the Optimization & Delivery section, make sure you select Conversion Events and Purchase. This will ensure Facebook optimizes to people who read 50% of your content, and you’ll be able to see how many show up in the Facebook ads manager.

facebook conversion optimization

Lastly, you need to make your ads. I opted for a simple Carousel ad, because it lets Facebook optimize which blog posts to show first in the ad. It is also an engaging ad format because people can interact with it and scroll along to see what other blog posts we have.

facebook ad type

The way that Facebook pulls in the Blog Post data automatically from your feed is by the product.name and product.url fields you see there. These can be combined with other non-dynamic text or other dynamic fields, however you like. To add other fields simply click the + button and all the fields from your spreadsheet will appear.

dynamic fields in facebook ads

Make sure your ads look how you’d like them to in the preview pane on the right, and test out different formats for your ads. I wouldn’t recommend inserting the price as is common with eCommerce ads, as you just made that price up. However, feel free to get creative by inserting categories, author names, tags, and any other variables you think can make the ads more compelling.

facebook dynamic ads

That’s it, that’s all you need to get dynamic ads set up on your blog. You’ll see this was a little more complicated than a normal Facebook promoted post or campaign setup, so what did we gain?

Well, now that this is all done, Facebook will automatically promote our blog posts as soon as we add them to our spreadsheet (we could even go on to automate adding them to our spreadsheet usingsomething like Zapier). Not only will Facebook automatically create the ads for each blog post based on the template we made, but they will automatically optimize the performance of those ads as well. We can very quickly roll out new ad variations that work by default for all products/blogs in our feed. In addition, because we added the Purchase event to fire when someone reaches 50% of our blog, we’re going to be driving high-quality visitors who actually want to read our material. Over time Facebook will get better at finding those people so our results will improve (here’s context on my views on the Facebook algorithm).

Finally, promoting blog posts using paid ads will give you that edge over competitors who don’t promote. It will help you supplement your organic traffic, and allow you to rank higher and quicker because you have more people visiting your page, which means more chances to share and link. Think of it like pouring gasoline on a fire to get it started quicker — you can’t run a whole fire on gasoline; you need that slow-burning charcoal, but you also have a lot of hungry guests (your blog’s stakeholders) who don’t want to wait forever for their food!

Ladder powers strategy and performance solutions for fast-growing brands

Talk to a strategist →

Growth is a high velocity game.

Sign up to our newsletter to stay up to date with all the latest movements in the field.

More from

796+ open sourced growth tactics used by the best marketers in the world.
Explore our playbooks →