B2B Marketing Tip: Creating an AI Agent for Highlighting Backlink Opportunities

B2B Marketing Tip: Creating an AI Agent for Highlighting Backlink Opportunities

As many marketers (and small business owners) know, you need to get high quality backlinks to your content to improve top of funnel discoverability. There are some great (and potentially expensive) tools out there that can help with this; think Semrush, Ahrefs, SurferSEO, etc.

I was interested to find some more affordable, systematic ways of acquiring backlinks and came across some great resources: Help A Reporter Out (HARO, recently acquired by Featured.com which is also a great resource), Qwoted, Help A B2B Writer Out, and others… How these work are that you sign up, declare your areas of expertise or interest, and you receive emails with opportunities to answer questions and share your knowledge (and backlink). A lot of emails.

I was receiving at least 10-15 emails per day, sometimes more, each with multiple opportunities to pitch my experience, opinions, and business. However, many simply weren’t relevant. It took me maybe 15 minutes a day to scan these emails looking for the golden needle in the proverbial haystack. Often I would not find anything relevant (15 minutes wasted), and the next day when I felt I didn’t have time I’d skip it (more wasteful if I missed the one perfect opportunity that day).

Solving with a simple AI Agent

I decided to solve the problem by building my first AI Agent. It took me about 2 hours on my first try with much (typically frustrating) help from my ChatGPT co-worker. But I persevered because I could recoup the time within a fortnight and better yet, never miss a great backlink opportunity again. Below is my step-by-step guide to how I did it. Full disclosure: I’m not an AI expert, there my well be better, more efficient, or more reliable ways to solve this!

Pre-requisites for my AI Backlink Agent

I signed up to make.com as the base platform for building my agent. It’s a pretty intuitive UX but actually relatively complicated when you get in the myriad features and linkages. I used ChatGPT to some success to help me (it went wrong a few times but by that time I could figure out myself how to correct – despite the AI guidance to the contrary.

I have Microsoft Exchange as my email platform (but you could easily use Google Mail or others), and ChatGPT was my current AI LLM using the ‘Plus’ plan. You also need an API connection to ChatGPT through OpenAI – although connected, this is somewhat separate from ChatGPT and you need to go to your OpenAI Account Dashboard (https://platform.openai.com/account/api-keys) to find or create your API keys and to add some payment methods and credit. Yes, there is a marginal cost, more on that at the end of this article.

Summary of tech stack:

Step 1 – Sign up to make.com and create a scenario

Once you’ve signed up (I’m using the free plan), click ‘Create a new scenario’ in the top right. This takes you to a canvas where you can add the relevant nodes and paths.

Scenarios in make

Step 2 – Add your starting node

Add your first node, in my case Microsoft 365 Email. The connection is pretty straight forward and amounts to pretty much a single click process. The type of node used is ‘Search Messages’. I wanted to retrieve messages from my inbox that met certain criteria (for example from the senders of backlink opportunities) and also limit to today’s date so it didn’t recursively pull every email and burn through my credits. I also set a limit on the number of results for the same reason, just to safeguard against a runaway workload.

The first node is the trigger event – in my case, I wanted it to run daily, so I set a schedule to trigger every day at 11:59pm. Simply click on the little clock icon next to the first node to configure this.

Search emails node in make

Step 3 – Add routing nodes

This is where ChatGPT got confused and sent me into a loop of building something that didn’t work at first. I wanted the Agent to not only read and summarize all the relevant incoming emails, but I wanted it to move the original emails after it had done. I therefore needed a Router node to create two paths. This is because my later ChatGPT node wanted all the information together (to review and summarise), and my MS Outlook ‘Move A Message’ node needed each individual email to move them to a folder.

So the Router note is pretty simple, it just creates two paths. The first path routes to an Aggregator (more on that in the next step), and the second to my ‘Move A Message’ end node. Just to cover off that final step simply here, the move a message node simply looks up the message ID from the first step (which is passed through the router) and sends to a designated folder (the code that appears here happens after the fact, when you click the ‘+’ icon, you can just choose your folder by name). Quick side note: the folder I wanted to select didn’t show up. Despite spinning on this a while, I still have no idea why. So I created a new folder in Outlook and that worked.

Moving emails node in make

Step 4 – Aggregating the emails for Chat GPT

The Array Aggregator basically takes data from the first step (all the emails that match my search criteria) and turn it into one block of information that ChatGPT can review in one go (rather than needing to cycle through each email individually and perform the operation multiple times). Here you’re just selecting the fields that you need: Message ID, Received Date Time, Subject, Body, Sender, and From.

Aggregating data in make

Step 5 – Have a LLM review and summarise the emails

Next step, I used a ChatGPT node to perform the action I needed. Some notes here that I learned along the way. First, the method to use is to ‘Create a Chat Completion’ (i.e. a prompt). Secondly, use a simple model (I’m using gpt-3.5-turbo). The latest and greatest models will cost more and frankly this is a simple prompt.

For the actual message, the role needed is a ‘User’ – this is basically emulating how you would use the LLM. For the Text Content (i.e. the prompt I want to send to ChatGPT), again, this took a few cycles to get right (ChatGPT itself kept giving dud advice). Below is a cut and paste of my Text Content that worked. I’ve indicated where you would need to add your own information. The bottom section is just a case of selecting the relevant fields that are getting passed through from your Aggregator step.

---------

Summarize the following email messages, extracting only relevant backlink or PR opportunities for <company name e.g. ‘B2B Planr’> (<company description e.g. ‘a SaaS business that provides online planning tools for B2B marketers’). For each relevant opportunity, include:

- Who is requesting it (name + org, if known)

- What they’re asking for (brief)

- The deadline (if mentioned)

- Suggested response I could use to pitch <company name>

Here are the messages:

{{map(12.array; "From:" + (12.array[].from.emailAddress & "\nSubject: ") + (12.array[].subject & "\nDate: ") + (12.array[].receivedDateTime & "\nBody: ") + 12.array[].body.content; "\n\n---\n\n")}}

---------

Step 6 – Create and send yourself a message

My last step (other than to file the emails into a folder, covered above), was to summarise the ChatGPT output. You’re basically using the MS Outlook ‘Create and Send a Message’ node and telling it what to include in the subject (static text e.g. ‘Backlink Opportunities Digest’), the body (the fields from the ChatGPT step and some formatting – you could do much more here if you wanted), and who you want to send the mail to (yourself presumably, but could be anyone).

Prompting OpenAI in make

Conclusion – Testing, Activating, Paying

That’s it. That’s your AI agent. Save it and simply run it once to test it. Then assuming all is well, make sure it’s activated and scheduled to run daily.

Just a note on cost. Because you’re calling an AI API (not just manually inputting a prompt) OpenAI does charge you. Note, my pricing/costs are correct at time of publication and your mileage may vary. Currently, with a few emails a day running through one prompt, it’s costing me <$0.01 per day. That’s a pretty good return for saving me 15 minutes of work. Now I can spend that time actually responding to backlink opportunities and improving my marketing, rather than reading through emails!