[TAIL] I Just Built Three Bots for Facebook Ads - Part 2

You’re getting this email because you’ve signed up for my AI Mini-Course. Welcome to TAIL (Tiny AI Lab), my exclusive newsletter where I share my nerdy thoughts with my fellow nerds.


Hello,

Let’s keep going.

I had all the ideas for my bots in my head.

Now, it’s time to build them.

Years ago, I would have to draw flowcharts and hire a programmer to make these bots.

But now, thanks to powerful AI, you can use AI as your programmer — no need to hire anyone!

Here’s a quick recap of what these three bots will do for me:

  • Bot A: Write the headlines and main text for Facebook ads.
  • Bot B: Review and approve the ads.
  • Bot C: Launch the Facebook ads.

Let’s start with Bot A.

I asked ChatGPT:


“Help me build my Facebook Ads Agents. Here’s what I need them to do:

  • I’ll give a list of product URLs and images in a Google Sheet. This sheet will have: “Product Name,” “Product URL,” “Product Image URL,” “Discount Code,” “Discount Code Objective,” and “Target Audience.”
  • Bot A will write the Facebook Ads headlines and main text using a template I provide. I’ll tell it to format the text like this: [EXAMPLE of my ads - Sorry, I can’t share it here 😜].
  • Bot B will review the headline and main text from Bot A. If it doesn’t meet my needs, Bot B will ask Bot A to rewrite it until it’s right.
  • Bot C will take the headline and text from Bot B to create Facebook Ad campaigns. It will aim for people in the US aged 35 and up— I might change this later.
  • Everything will be saved as a draft.
  • I’ll check and approve them before they go live.

Revise and design how to create this agent for me. If you have any suggestions, let me know.”


Then, ChatGPT gave me steps like setting up Google Sheets and my Facebook Developer Account.

I followed the instructions step by step.

Even though ChatGPT gave me all the steps, I still did it piece by piece, as usual.

(sorry for my crappy English 😅)

After I set up my Python environment, I created the Google Sheets and started copying and pasting the code for that part first.

I ran into some issues with the Google Sheets connection. So, I asked ChatGPT:

Whenever I saw an error, I’d copy it and tell ChatGPT:

“Hey, I got this error [Error Message] after I did [The step I was doing].”

ChatGPT helped me fix those issues.

Then, I tried adding product info to my Google Sheets and let Bot A read it.

Bot A had trouble reading it, so I asked ChatGPT again, and it fixed it.

If I had more problems, I just kept asking ChatGPT for help.

I did the same for building Bot B and C until they were all done.

Building Bot A and Bot B wasn’t hard because it was mostly about AI text generation.

There was one issue where ChatGPT didn’t use the latest version in the code, which caused errors because some methods were outdated.

Bot C was the hardest part. It wasn’t even an AI bot; it was just about automating the launch of Facebook Ads with the data I provided.

I found out that ChatGPT hadn’t updated the Facebook API documentation in its system yet.

It made a lot of mistakes in the code when I was building Bot C.

Even when I said, “Hey, I got this error: [Error Message],” it tried to help, but things still didn’t get fixed.

I was stuck for hours...

Then, I thought the easiest fix was to check the Facebook API documentation. I opened the page for creating a Facebook Ad Campaign.

I copied the code part from the Facebook API documentation and asked ChatGPT to rewrite my code based on that example.

I told it: “Hey, I got this error: [Error Message]. Here’s the example code from Facebook API Documentation: [Code] Can you fix your code with this?”

That worked really well.

Sometimes, if the documentation was hard to understand, I’d Google it and copy answers from StackOverflow (a site with lots of expert programmers) and paste it to ChatGPT.

That worked like magic!

You just need to give ChatGPT some examples.

When I reached the final steps of creating the Facebook Ad Campaign, I hit another snag with some settings (like Bid Strategy and Impressions) that I didn’t use but needed to include in the code.

My CTO once told me that Claude Sonnet (another AI) is very good at writing code.

I pasted my code into Claude’s chat and explained my error, and it returned the fixes right away.

Claude’s interface was different from ChatGPT. It separated the code into a new window and explained what I needed to change.

It was perfect for programming tasks.

My problems were solved in just a few hours.

I thought if I had used Claude to build the Agents from the start, I could have finished much faster 😆

But it’s all done now, thanks to ChatGPT and Claude!

Okay, this email is getting long.

Wow…this is a bit geeky.

I hope you see how to build AI Agents or use AI to create any tool for yourself now.

If you don’t understand something or have questions, let me know!

Your feedback keeps me writing. Thanks to everyone who replied to my emails! :)

Talk soon,

—Bank K.

P.S. I’m busy working on another AI bot now, so it’s tough to keep everything updated in my emails.

I share my daily progress on my AI projects on X (formerly Twitter). You can follow me here: https://x.com/ifourth

Check my latest tweets! I just made some updates to the Jesse PODMan (not live yet). It’s going to be much more convenient to use soon!