The biggest mistake I see with junior marketers is taking pride in doing a great job on mundane tasks that should have been automated. Make the computer do it and clear some headspace for more important things. Mastering APIs is how you scale to $20k+ per day.
The way to make changes in your ad accounts automatically is via their APIs, which is just how computers talk to each other...More
Hey, I just got off the phone with the client, and they’re asking when we start rolling out automation on their account
The obvious thing for me is pausing poor performing ads
They have a bunch of ads in Facebook that have low CTR, and if we can write a script we run periodically to pause them, they’ll save money
Can you get set up on the Facebook API and give that a try?
This course is a work of fiction. Unless otherwise indicated, all the names, characters, businesses, data, places, events and incidents in this course are either the product of the author's imagination or used in a fictitious manner. Any resemblance to actual persons, living or dead, or actual events is purely coincidental.
Understanding how to make API calls is one of the fundamental building blocks of technical marketing. APIs are how computers talk to each other, so if you can write your own code to make an API call, you can automate many routine, boring tasks without having to log in to your ad account and do it manually.
There are multiple methods for making API calls, and each platform is different. However they all have the same components. You need to be able to authenticate to the API, so it knows it’s you calling, which is done often with an account ID and access token (analogous to your email and password for logging in manually). There are also API endpoints, or the URLs you call with your script to do certain things or read certain data (similar to URLs on the website, which know to return certain pages). Finally there’s the parameters you pass alongside your request, essentially additional information on filters, limits, and other options that are listed in the API’s documentation.
Making calls to API in Python is usually done with the requests library, which lets you read data as well as push activities to almost any API. There are usually SDKs available for popular platforms, libraries that make API requests easier, but in practice it’s usually more stable to make your own API requests because you’ll be surprised how often the official SDKs aren’t up to date, or do something different from what you expected. Some platforms like Google Ads make automation easy, with Ad Scripts letting you write code directly in the platform. Facebook provides the Open Graph Explorer, which simplifies getting access tokens and making API calls to see what results you get. Others only give you documentation, and for some you have to go through a lengthy approvals process.
Within Facebook specifically you can do most things you would normally do in the ads manager interface. There’s a reporting API which lets you pull data and use it or display it any way you wish, rather than relying on the default reports you see in the interface. Facebook also allows access to push changes to your account, for example increasing budgets, changing targeting, or turning off poor performing ads. It takes more work up front to automate a task, but once you have the script written, it can take mere seconds to run it whenever that task needs to be done again, saving you time for more valuable strategic work on the account, and driving significant performance gains.
Complete all of the exercises first to receive your certificate!
Share This Course