How to: Personalize Any Web Page for Marketo Contacts

Anyone else using #mopscrush Sandy Whiteman’s solution for pre-filling forms?  It’s easy and elegant.  Sandy alludes to this possibility in his post, but you can easily extend it to dynamically personalize any web page content for known Marketo contacts.

Some major plusses:

  • We can personalize any page, not just Marketo LPs.
  • We can use your existing CMS.  There’s no need to implement some stupid/expensive/custom one.
  • This goes beyond dynamic content for remarketing ads — we’re not just pulling through a search term.  We can populate company name, contact name, industry, onboarding stage, countdown to renewal, Customer Service rep, etc.
  • No need to pay for Marketo’s Website Personalization module for simple personalizations like showing a contact’s Company Name.

>> Related: How to Seamlessly Use Unbounce LPs with Marketo <<

How it works

Here’s a simple example:  I want to display a demo thank you page that welcomes “Acme Corp.”  So I’ll configure the page to include a span with a class of leadInfo to specify elements to be personalized if I know the value of the Company Name attribute. I also add a data-fieldname attribute to specify which Marketo field will hold this information.

<p><span style="background: #FED8B1">Our product can help <span class="leadInfo" data-fieldname="Company">your Company</span> sell more widgets.</span></p>

When you call DTO.getGlobal()["mktoPreFillFields"] on your external page, it’s going to return an object that looks something like this:

	FirstName: "John",
	LastName: "Smith",
	Company: "Acme Corp.",
	Email: "[email protected]"

You can then use a simple JS script like this to use the returned values to personalize all of your leadInfo elements and set the value dynamically:

let mktoLeadInfo = DTO.getGlobal()["mktoPreFillFields"];
let elsToPersonalize = document.querySelectorAll('.leadInfo');
    function(e) {
        let elFieldName = e.dataset.fieldname;
        e.textContent = mktoLeadInfo[elFieldName];

Unknown users will see this:

Our Product can help your Company sell more widgets.

But John Smith at Acme Corp. sees:

Our Product can help Acme Corp. sell more widgets.

In short, all the charms of ABM and personalized web content, without having to replatform a website?  Yes please.

DISCLAIMER: In a production setting, you’d also want to make sure to validate that the data isn’t null, and you’ll also need to be careful you’re not exposing any messy or potentially sensitive data (e.g. “Joseph (Joey)” or “UNKNOWN COMPANY”).


Want tips, tutorials, best practices, and other cool stuff delivered to your inbox every moth?  Subscribe to the quarterly Sponge newsletter >

image via giphy

Sponge | Marketing and Revenue Ops

Get a System Audit

Whether you inherited a new instance or just want a second opinion, we'll dive in and benchmark your tech stack.

  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden

Sponge | Marketing and Revenue Ops

Download Resource

Use this form to recieve your free resource in your inbox today!