Thu Jan

Making Multiple Column Marketo Forms Responsive

By default, if you embed a multiple column Marketo form into a webpage the form will adopt a fixed width that will likely expand out of whatever container you put…

By default, if you embed a multiple column Marketo form into a webpage the form will adopt a fixed width that will likely expand out of whatever container you put it into.

You can restyle things, to a certain degree, with the custom CSS that Marketo allows you to edit, but this only gets you so far because of the built in html structure of the Marketo forms.

Because of this, I wrote a script that does a lot of the dirty work to make Marketo forms responsive regardless of viewport size.

The Script

The script will resize any Marketo form on the page upon rendering and on window resize. It does some math to calculate how many form fields there are per row and will apply an appropriate width to those rows for any viewport size.

One note is that you also have to include a simple media query for the mobile size. Don’t have time to get into that messiness in this post though.

After Running the Script




This is just one of the many things you can achieve with the Forms 2.0 api. I have a much more complete and fleshed out script that allows you to:

  • Determine if you want the form styled
  • Specifcy button alignment and text
  • Strip out and entirely restyle the form
  • Adapt the form for a dark or light background
  • Alter radio and checkboxes styling

Comment below or contact me if you are interested in taking a look.


Thu Feb

How to Create a Custom Google Analytics Landing Page Conversion Rate Report

In this post I’ll demonstrate how you can set up a custom report to track landing page conversion rates using a custom metric, and custom calculated metric in Google Analytics….

In this post I’ll demonstrate how you can set up a custom report to track landing page conversion rates using a custom metric, and custom calculated metric in Google Analytics.

You can track form fill with events, but this doesn’t allow you to get a really simple drilldown of form fills per page for some reason…

The reason I needed to generate this report is because Marketo does not provide an out of the box report for landing page conversion when you are using self-hosted landing pages (which I imagine is quite popular because their landing page editor isn’t great).

At the end of this tutorial, your report will look something like the below report.

Screen Shot 2016-02-25 at 8.02.57 PM

To achieve this take a quick view of this video, and if you have questions feel free to ask them below!


Fri Feb

Marketo API Driven Google Analytics Custom Dimensions

Marketo isn’t the best with reporting. I find their analytics to be quite janky, visually unappealing, and kind of annoying to build. Something I’ve wanted to do for a while…

Marketo isn’t the best with reporting. I find their analytics to be quite janky, visually unappealing, and kind of annoying to build.

Something I’ve wanted to do for a while is build in Marketo data into our Google analytics. I did this using Google Analytics Custom Dimensions.

Because I previously integrated MODX  with Marketo I am now able to pass lead data to custom dimension parameters in the Google Analytics javascript snippet that they provide.

As an example here is what I’m currently running on Google Analytics.


	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  ga('create', 'xx-xxxxxxx-x', 'auto');
	  ga('send', 'pageview', {

In this snippet I am measuring the email (unique lead identifier), industry, and salesperson of everyone that visits our site! This allows me to do some really neat stuff in google analytics when it comes to reporting, and I love me some google analytics reporting.


Screen Shot 2015-02-13 at 3.26.24 PM


Screen Shot 2015-02-13 at 3.24.58 PM

Salesperson Traffic

Salesperson Custom Dimension

Next up is measuring specific events, custom metrics, and other fun stuff. I’ll hopefully put up a post soon! 

Tue Feb

XebiaLabs Marketo Lead LifeCycle Model

This post was originally posted in our internal updates section, and it is written with the intention of the audience being fellow employees. Just keep that in mind when reading!…

This post was originally posted in our internal updates section, and it is written with the intention of the audience being fellow employees. Just keep that in mind when reading!

Screen Shot 2015-02-03 at 10.03.18 AM

New Lifecycle Flows / Logic

We have a completely new lead lifecycle model now. It is powered by our use of three different  Marketo / Salesforce fields as well as some robust lead scoring protocols. Below you will find the explanations for what happens during each of the model’s transitions. If you have any questions please comment below so that we can gather feedback and ideas in a central locations.

Anonymous => Marketing Accepted

A lead is considered Anonymous when we do not have their email address or other base information to communicate with them. When a lead fills out a form or is synced to our Marketo database via an API, list import, or other method they become a Marketing Accepted lead, and their “Lifecycle Status” is set to Marketing Accepted in Marketo.

Marketing Accepted => Trash

A lead’s stay in the Marketing Accepted bucket is sometimes short lived. We have smarts lists set up to detect competitors, employees, SPAM / TEMP emails, blacklisted countries, as well as many others. If a lead is moved to the Marketing Accepted bucket, and is included in any of these lists they are quickly shuttled to the Trash bucket where their lifecycle status becomes “Trash”.

Marketing Accepted => Passive Marketing

When a lead is in the Marketing Accepted bucket we are continuously marketing to them. However, if a lead shows no interaction with us for 90 days we make the assumption that they are not interested, and as a precaution we throttle our communication with them by moving them to the Passive Marketing bucket where their lead lifecycle status becomes “Passive Marketing”.

Marketing Accepted => Marketing Qualified

A lead is only moved into the Marketing Qualified bucket once they reach our predetermined score threshold. I will be writing a post shortly about our scoring methodologies, but for now just know that we rate users both demographically and behaviorally. If they reach a certain level they are synced to Salesforce and are considered Marketing Qualified and their Lifecycle Status & Lead Status is set to “Marketing Qualified”.

NOTE: This is where the complex communication between Marketo and Salesforce begins, and it is facilitated by our use of several fields. In Marketo we use “Lifecycle Status” and in Salesforce we use “Lead Status”, “Disqualified Reasons”, and “Opportunity Stage”. These four fields, three of which are located in Salesforce, are what drive the new lead lifecycle model.

Marketing Qualified => Sales Accepted

A lead should never last more than 72 hours in the Marketing Qualified bucket. This is an SLA bucket as denoted by the time clock icon in the graphic. When a lead is synced to Salesforce all the BDRs are notified and tasks are created in Salesforce. Once a BDR marks the lead as Sales Accepted in the “Lead Status” field the lead is moved from the Marketing Qualified bucket and in the the Sales Accepted bucket in Marketo and their Lifecycle Status becomes “Sales Accepted”.

Sales Accepted => Trash

In the event that a lead is a competitor, an employee, or other garbage a BDR can change the “Lead Status” to Trash, and this will cue Marketo to remove them from Salesforce altogether, mark their “Lifecycle Status” as Trash. This should only be enacted when a lead is 100% guaranteed to be Trash. In most other circumstances a BDR should use the Disqualified “Lead Status” in conjunction with the “Disqualified Reasons” field to get rid of bad leads.

Sales Accepted => Disqualified

When a BDR encounters a lead that is actually a partner, isn’t responsive, or in some other capacity isn’t quite a lead yet they should mark them as Disqualified in the “Lead Status” field and follow this up by selecting the reason they disqualified them in the “Disqualified Reasons” field. Once these two fields are selected Marketo will move the lead to the Disqualified bucket, change the “Lifecycle” stage to Disqualified in Marketo, and take a couple of other behind the scenes actions.

Sales Accepted => Sales Qualified

When a lead is in Salesforce a BDR will move them sequentially through Sales Accepted, Contacted, Meeting Pending, and Meeting Booked as the “Lead Status”. Once the “Lead Status” has been changed to Meeting Booked a lead’s “Lifecycle Status” will change to Sales Qualified. In the future we will likely change this based on BANT and other qualifiers.

Sales Qualified => Trash

At this point a BDR or Salesperson can still shuttle someone off to the trash by marking them as Trash in the “Lead Status” field. This is likely not going to be a common flow, but is still an option.

Sales Qualified => Disqualified

Once a lead is considered Sales Qualified a salesperson will pick things up, and may discover information that will encourage them to disqualify this person. For example, if the person doesn’t have the budget, isn’t ready for one of our products, or is actually using something else and is happy with it then they can be disqualified. To do this mark the lead as Disqualified in the “Lead Status” field, and as before provide a reason in the “Disqualified Reasons” field. The reason provided will guide the lead in a number of directions. For example a lead marked “Not Ready” will reside in the Disqualified bucket for 9 months then will pass into the Passive Marketing bucket where we will begin to market to them again.

Sales Qualified => Live Opportunity

A lead will be shuttled to the Live Opportunity bucket when a Salesperson or SE marks their “Lead Status” as Live Opportunity, when they are associated with an Opportunity, or when their “Opportunity Stage” is set to an appropriate setting. This was a very complex transition that was hindered slightly by our current business processes. If anyone has an idea of how they would like this to happen please let me know.

Live Opportunity => Lost Opportunity

When a lead has their “Lead Status” marked as Lost Opportunity or their “Opportunity Stage” is set to closed/lost they will be moved into the Lost Opportunity bucket where they will live for a while, until then being passed to the Passive Marketing bucket.

Live Opportunity => Customer

When a lead’s “Lead Status” is set to Customer or their “Opportunity Stage” is set to closed/won they will be marked as a Customer, added to the Customer bucket, and their “Lifecycle Status” will become Customer. Here they will live indefinitely until they in some manner exhibit Up-sell activity.

Customer => Up-sell Opportunity

Right now this transition is not active. As a company I believe we need to highlight what we consider to be reliable up-sell activity, and once this has been determined with can build it into our flow.

Customer => Lost Opportunity

A customer transitions into a Lost Opportunity when their “Opportunity Stage” is changed to closed/lost or “Lead Status” is changed to Lost Opportunity. This will happen when a user churns, or is not using the product. Their “Lifecycle Status” will change to Lost Opportunity, and they will live there until they are moved to Passive marketing within a predetermined amount of time.

Disqualified => Partner

When a BDR or salesperson Disqualifies someone using the “Lead Status” and “Disqualified Reason” field they are sent to the Disqualified bucket for a little while. This is where Marketing uses the information from sales to determine where in the model the lead should go next.

As an example, a BDR notices that the lead is actually a partner, Disqualifies them and then marks the Disqualified Reason as “Partner”. They will be moved almost immediately from Disqualified into the Partner

Disqualified => Passing Marketing

As another example, a BDR is unable to get in contact with a lead (likely because they are unresponsive), they will disqualify them with the “Lead Status” field and mark them as Unresponsive in the “Disqualified Reasons” field. They will then be shuttled from Disqualified to Passive Marketing where they will be given the chance to reactivate. If not they will move down the failure path to the trash.

Disqualified => Trash

As another example, a BDR gets in contact with someone, but they are in the wrong department…  They will disqualify them with the “Lead Status” field and mark them as Wrong Department in the “Disqualified Reasons” field. The lead will then be shuttled from Disqualified to Trash. This could also be accomplished by simply marking someone as Trash in the “Lead Status” field.

Passive Marketing => Marketing Accepted

When someone is in Passive marketing it could be because they were inactive for 90 days, they were unresponsive during the sales process, or a number of other reasons. However, if a lead is passed to the Passive Marketing bucket they are given the chance to reactivate by visiting our site, clicking an email, or another action. If this happens they are moved back into the Marketing Accepted bucket where they will be marketed to more actively.

Passive Marketing => Inactive

When a lead is in the Passive Marketing bucket they are given another 90 days to prove that they actually exist. If they do not do anything to move themselves back into the Marketing Accepted bucket they are moved to the Inactive bucket where all marketing communications are halted.

Inactive => Marketing Accepted

If a lead is moved to the Inactive bucket they are given another 180 days to reactivate. If they do they will be moved back into the Marketing Accepted bucket.

Inactive => Trash

After 360 days of not opening email, not visiting our website, not engaging socially, and essentially ignoring us in every aspect of the world we no longer need to have a lead in our database. They will be moved from Inactive to Trash where they will live until one day they are deleted permanently.

New Fields / Values

LifeCycle Status – Marketo

Anonymous – No email, no name, no phone, and not a real lead yet.
Marketing Accepted – Basic information provided to be considered a lead.
Marketing Qualified – A lead that has reached a certain score threshold.
Sales Accepted –  A Marketing Qualified lead that has been accepted by sales.
Sales Qualified – A lead that has had a meeting succesfully booked or has been qualified by their Demos.
Live Opportunity – A lead that has an associated opportunity in salesforce, has their “Lead Status” set to opportunity, or their “Opportunity Stage” set to an appropriate field.
Customer – A Lead that has a “Lead Status” of Customer, an Opportunity Stage of closed/won, or is in our built in customers smart list.
Up-Sell Opportunity – A lead that has exhibited up-sell activity
Disqualified –  A lead that has been disqualified by sales.
Partner – A partner
Passive Marketing – A lead that is recycled from sales, inactive for over 90 days, or disqualified in some acceptable manner.
Inactive – A lead that has been inactive for more than 180 days.
Trash – A lead that has been inactive for over a year.

Screen Shot 2015-02-03 at 12.26.56 PMLead Status – Salesforce

Below you can find descriptions of when each field should be used in the Lead Status option.

Marketing Qualified – This is the default state of a lead that is synced to Salesforce.
Sales Accepted – Used when a BDR or Salesperson has seen the lead, and has begun working on it.
Contacted – Used when a lead has been contacted.
Meeting Pending – Used when a meeting is pending.
Meeting Booked – Used when a meeting has been successfully booked.
Live Opportunity – Used to identify a lead when they have an opportunity. They should also be associated with an opportunity at this point.
Customer – Used when an opportunity concludes and a lead converts into a customer.
Up-Sell Opportunity – Set when a customer exhibits up-sell activity.
Lost Opportunity – Used to identify leads that lost an opportunity or customers that have churned.
Disqualified – Used when a lead is disqualified for one reason or another.
Trash – Used  when a lead is 100% garbage.
Recycled – Used when a lead needs to be recycled.

Screen Shot 2015-02-03 at 12.27.22 PMDisqualified Reasons – Salesforce

No Budget
Not Ready
Using Something Else
Bad Contact Information
Wrong Department

Screen Shot 2015-02-03 at 12.48.57 PM

Only about 1/10 of the flows I had to create….

Final Note

I spent an entire day crafting smart campaigns in Marketo to shuttle leads into their correct buckets based on their activities, current lead status, and other details.

I had to dedicate this much time because all of our leads were using different values, and the ones that were using the correct values were 50% of the time out of date or incorrect.

As a company we’ve been really bad at using these fields consistently, correctly, and in a timely manner both in Sales and in Marketing.

If we use these fields every time we check a lead or contact record in Salesforce or import a list in Marketo everything should run like a well oiled machine.

Please do your part to make sure our machine is healthy!

Planning Video

For anyone who is interested in how we planned all of this out, the logic behind why we did things the way we did, and other stuff!

Tue Dec

MODx Marketo Integration for the XebiaLabs Website

XebiaLabs uses MODx for its content management system and Marketo for its marketing automation system. To integrate Marketo into MODx I came up with an extremely creative solution that used…


XebiaLabs uses MODx for its content management system and Marketo for its marketing automation system. To integrate Marketo into MODx I came up with an extremely creative solution that used a custom PHP class to pull Marketo lead data from their SOAP API and then subsequently populate that data into corresponding MODx “placeholder” elements.

First I found a php client for pulling the information from Marketo’s SOAP API, they provide some code here to pull lead data, but I wanted something I could use to pull other information from their API. turns out, someone had already done much of the heavy lifting.

I then coded the below snippet that does the following.

Initially I check to see if I’m specifying a lead manually by passing someone’s email in a query parameter. This is a nice override for when I need to view pages as a specific person within our database. It’s also nice when I need to ensure that someone sees a webpage with their info. I can append the link I have in an email, for example, to include their email, and subsequently ensure they see they website as they should. They may not have a munchkin cookie after all.  If I view a user in this method I store the information in a session so that I don’t have to perpetually communicate with the Marketo API for future pageviews.

If I then view any subsequent page on the website my information gets pulled from the session.

If I don’t have a query parameter specified for a user, and I don’t have any sessions from a previous website visit I use the PHP client to see if their is a munchkin cookie in the user’s browser.

If their is I pull the viewers lead data using their munchkin cookie. Then, as with the query parameter example I store the user’s info in a session variable so that I don’t have to communicate with the API again.

After lead data is stored in a session or pulled directly from the Marketo API I am then able to pass the information to a built in MODx method for displaying information. I use something they call “Placeholders”.

Learn more about placeholders here.

Check out the code here:

This code is lacking some serious security precautions and error handling. It is being worked on for the future, and I will try to update. Please comment if you would like further direction.


Subscribe for More!

I send out a monthly newsletter on various topics.

Take a moment to enter your details, and you can select the news you would like to have delivered to your inbox!