FREE

Pause all the worst performing ads

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.

Learn

API Calls

The way to make changes in your ad accounts automatically is via their APIs, which is just how computers talk to each other...

Experience

Simon Kreienbaum

Built an ad operations automation tool.
Logo
Logo
Logo
💪 Useful 0
😓 Difficult 0
🎉 Fun 0
😴 Boring 0
🚨 Errors 0
😕 Confusing 0
🤓 Interesting 0
Free access for email subscribers.
Python experience recommended.
Usually completed in 22 minutes.
1. Scenario
VEXNOMICS OFFICE – LATE THURSDAY
Gustav Gieger
at GoolyBib

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.

2. Brief

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.

3. Tutorial

In this video, I'm going to explain to you how you can get data from the Facebook ads API. So how you can access your ad account programmatically via the API.

PauseWorstAds.ipynb.xls
Download
4. Exercises
5. Certificate

Share This Course