by Dave | activecampaign
In this video we’re going to talk about how to add leads automatically to Active Campaign from Google ads. They have this extension called lead forms. People refer to this lead form ads. And there’s a link there that takes you to some code that you’ll need to install on your hosting. So let’s dive right in.
Mike Rhodes from AgencySavvy was kind enough to share this information, and when I went to look at this site, that one thing that caught my eye was this statement right here. Optional web hooks allow lead data to flow directly to your CRM. In other words, as soon as someone signs up, they can be put into your Active Campaign account, automatically. It does require webhooks. My first thought was, okay, let’s use Zapier. However, Zapier gets a little convoluted, especially if you want to use this multiple times.
So instead of using Zapier created a custom script that will catch the information, put them into your ActiveCampaign account and fire off an automation to send them the appropriate emails after you add them to a lead. So let me show you how this works.
So inside your Google Ads account, you want to create a new campaign and this works with leads.
Now, this is supposed to work with video, but my account, it’s not set up yet. It does work with search. So I’m going to go ahead and do that, not going to worry about this. I’m just going to click on continue, not going to worry about any of this right now. Just keep going down, down, down, down, down to here and you want to add an extension, lead form extension, create lead form extension. And again, I’ll let you put in everything you want to do here.
Now right now, this is what shows up in my account. So there’s four things that I could collect, and you might consider it collecting as little as possible or as much as possible and one reason you might want to collect a lot is simply to filter out people. If you keep it just to like an email field, you might get everybody in their brother, that can be expensive and you might not get the leads that you want if you want to do everything, if somebody does feel that they’re probably interested in what you’re offering.
So go ahead and fill out all the information here that’s asked, you definitely need to link to your site and for the purposes of this demonstration, I am going to choose everything, and then click on lead delivery option. Like I said, you’re going to you can change everything in there that you want. So if I click on download, it’s going to say that and then you want to put a link in there or visit website, whatever.
But what we’re doing here is down here, this is what we need to put in there. So first thing you need to do before that is Go back to this URL right here and you want to copy all this code from start to bottom, and then inside your hosting account, so I would recommend creating a subdirectory called Google on your site, and then a script called web hook.php.
Now, this may not work if you’re using WordPress type hosting, a lot of times they don’t allow external scripts or different scripts and WordPress to be on your their site. But this is what you need to do. And then go ahead and copy all this code here and there’s only a few things you need to do here. I highly recommend doing this. If you recall, there’s four fields they send over.
One is I believe, username, user, email, phone, and postal code, those are all that they can send over, there may be more in your account. So the way I’ve set it up is for those four fields. The reason I recommend creating a custom field called postal code is if you do collect it, but it doesn’t exist an ActiveCampaign stuff breaks, this doesn’t work properly.
And then the second thing you need to do is get your Active Campaign API credentials, and where you find that is inside your Active Campaign account settings, developer, API, access URL and key. And then in Google ads, and this is the magic and there is the reason I recommend doing this versus using Zapier, because we’re going to trick this into using the key that we set in Google ads as our tag in Active Campaign. Got it?
And the reason why I do that is we can reuse this same script over and over and over again and not have to update anything outside of Google ads. If you did this, and Zapier, it would be a lot more convoluted and you’d probably have to have one zap per Google ad. That could be a lot.
And then optional, but highly recommended, create an automation ActiveCampaign that is triggered by the tag that you have When you do that automation, add them to a list if you don’t add them to a list you can’t send to them. And then of course test, you have to come down here and set this to Yes, and then send some test data and we’ll go through this and go see that this email address went and received the expected actions if they did, great! Set this to no, so my recommendation This is no in production. Yes, when you want to test.
Let’s start with creating a postal code custom field. So inside here on to go to lists, manage fields, and I’m going to create one.
Next step is to get our API key and URL. So to do that, we come into here we go to settings, we go to developer, there’s the URL, and there’s the key. I’ve already copied those over and installed it on the script on my site, so I don’t need to Do that. But you would need to come in here, paste it in here in between these single quotes, there and there, save this file to your site.
And that’s it.
Now, we’re going to do a test in a minute.
So I’m going to have this set to Yes, but let’s go back to Google ads and again, this is the key. So I want to give it the appropriate URL. Let’s see if I have it. There’s where I’m sending it to I told you to do like Google and then webhook.php. Now here’s the biggie. I’m going to suggest this is a tag inside your Active Campaign account. However, you name tags, and the great thing is, you don’t even have to have created this tag already.
Let’s go see how this works. So it’s going to send over some data. After I click on Send test and it should say there was sent successfully, you can check to see what What was sent, and most importantly, this email address was used. So now, inside my email account I want to look for that person, does not have a double quote.
So notice there is the postal code, there’s the phone number, properly formatted. Trust me that plus one’s important. A lot of times people send over information makes it difficult to do SMS messaging. And then there’s the tag. And really, I should have a camp automation that fired based on that tag. So let me do something like that real quick.
Okay, I’m going to create an automation called the same as my tag. That’s just going to make it easy for me and I may have multiple automations based on the tag, based on the campaign that gets used. So I’m going to go ahead and click on Start trigger when tag is added which I believe is this, continue. You could ever run one or many times, I’m just going to do it once.
And then from here, you can do whatever you want, send an email, tag them to something else, put them in a different automation. But probably most importantly, is you want to put them on a list. Because if you don’t do that, or you can’t send any emails, so that’s kind of important, and then do whatever you want. So going back to here a little bit, just want to show you what’s going on underneath the hood, you don’t need to know this, but I’ll just give it to you so you do.
This function right here that splits the name into first and last and actually middle name. Because Active Campaign doesn’t take full name. So we have to split in first last, we make sure you have your API URL, and this should say URL, and this should say key so I will fix that. We get the input that sent over, clean it up, put it into an array, do we want to have allowed test data or not? If we don’t, and it is tested, and we say, Sorry, then we grab this tag important, in my opinion is that this Google key, this thing right here matches what you want to have as a tag.
And then there is some more information form ID, campaign ID, API key that could be passed into Active Campaign, you’d want to create a custom field for each of these. But notice, I’ve got double slashes here. That means this is commented out so I’m not using it, you could if you wanted to.
And then down here, we go through the user information and get the email name, phone and code, if they exist, usually, at the very minimum will be email, but you can also have name, phone and code, and then we get everything ready, and then we pushed into ActiveCampaign.
So that’s how you take Google Ads lead form extension lead and put them into your ActiveCampaign account.