Fix Full Names in First Name Field in Marketo

Corey Northcutt    By under Marketo Marketing.

We've all gotten that marketing email where the subject line begins:

Hi Corey Northcutt, ...

And we all have the same reaction. Any hope of appearing genuine was instantly lost.

Sure, it's probably on me. I probably put my full name in an ambiguous field marked "name". But that's not how I'll see it now. An instant is all it takes to lose somebody.

So imagine my horror when I discovered that out-of-the-box, Marketo doesn't prevent this. In fairness, few platforms do. But we can solve it. Here's how.


There are three ways to fix this.

1. Solve Before Entry

The Marketo blog a pretty good article on this. That method just uses JavaScript. But this assumes that nobody in an organization ever inputs leads a different way (import, other forms, landing page builders, etc.).

2. Solve via Webhook

Webhooks can be triggered in Marketo almost anytime anything happens. And they can do almost anything. Some serve a specific role, whereas others (like a Microsoft Excel plugin) leave the logic up to you.

3. Scrub via REST/SOAP API

This is the least elegant solution and isn't really even worth considering here, but in some situations, and for some platforms, you might consider just writing a script that regularly cleans up your database using an API.

Sanford Whiteman of TEKNKL points out on this thread that #1 is the ideal solution (and he's right). But if you manage clients, or have a larger organization, it can be very difficult to keep this level of control. Therefore, best practice is to do both.

Using the Excel Webhook

Since I already linked a post that solves #1, let's talk about #2.

1. Get Access

There are a few webhook services available for Marketo to run Excel functions against your database. I used the free Hoosh plugin. Signup for a free one and you'll be provided with a URL that includes name and password. You'll need that in step 3.

2. Create Webhooks

You're going to want two (one for first name, one for last name). Create them here:

marketo webhooks

If you don't see that option on your Admin menu, you may need to request that this feature enabled on your Marketo instance.

3. Configure Webhooks

This will be a little bit custom to the plugin that you're using. With the plugin that I mentioned, here's how you configure it.

  • URL: Provided to you in step 1.
  • Encoding: Form/URL
  • Response: JSON
  • Method: POST (this will be the case regardless of plugin)

Then, here are the working Excel formulas. You'll need one webhook for each.

First Name:

=LEFT("{{Lead.First Name}}",SEARCH("+","{{Lead.First Name}}")-1)

Last Name:

=RIGHT("{{Lead.First Name}}",LEN("{{Lead.First Name}}")-SEARCH("+","{{Lead.First Name}}",1))

Notice that I used a plus symbol instead of a space. That's because of Marketo's URL encoding. When the data gets passed to the webhook, there are no spaces.

When you're done there, remember to map the response data to fields in Marketo. Here's how that looks with the Hoosh plugin:

marketo map webhook

3. Trigger Webhooks

Now pop on over to your Marketing Activities, and down to your operational folders. Right-click to create a new default, operational program.

marketo marketing activities

Create a list named something like "Name Cleanup". And new Smart Campaign with the following Smart List:

marketo cleanup

This is done to limit the total # of leads that go through cleanup. If they already have a last name set, let's not mess with this whole ordeal and risk complicating good data (like when somebody slings a middle name our way).

Now, we create one more smart campaign, with a trigger set to fire when somebody gets added to the list in the step above, and this flow:

webhook flow

Notice that I processed last name first. That's because it needs the original first name variable to work. Once you activate these two new Smart Campaigns (on the "Schedule" tab), you can use the Results tab of this second Smart Campaign to be sure that it's working.

And that's it.

Final Thoughts

  • If you'd like, you can temporarily remove the trigger from the "Put on Name Cleanup List" Smart Campaign and run it once. That will fix all your outdated data.
  • Remember that webhooks must be triggered. If you use a green filter on your Smart List in the final step, instead of an orange trigger, this won't work.
  • This system isn't perfect. People with multiple names, middle names, a Chinese reversal of first/last names, will all present issues. This is only meant as a last resort after form entry cleanup has failed.

Now go make sure that you're calling people by the right name!