How to: Capture URL Parameters in Marketo with Cookies

If you’re a diligent marketer, you’re using UTM parameters on all your links so you can better understand which channels and tactics effectively are driving web traffic, leads, opps, and revenue.  But what happens when a visitor doesn’t convert immediately, or there are multiple Calls to Action on the page, or they navigate away from the page before converting?  Sponge recommends using cookies to capture URL parameters in Marketo.

>> Related: 6 Ways to Handle Those Pesky Spambot Clicks in Marketo <<

This tutorial helps you capture how someone got to your website in the first place, even if they bounced around your website a bit before filling out a form. 

(By the way, if you’re not sure what a UTM is, you’re not ready for this post!)

If your visitor is clicking around within one domain, the solution is simple:  you can use Sanford Whiteman’s 15-line, “dirt-simple UTM forwarder.” He outlines it in full here.

Tracking URL parameters across domains

But what if you’re trying to capture URL parameters in Marketo across subdomains?  Your visitor clicks on an email to a Marketo landing page, then clicks on your logo and ends up on your www. domain?  You want to track them across domains by dropping a cookie at the parent domain level.

There are plenty of different ways to do this, but I like to use this script.

  • It captures both the first- and last-touch UTM parameters.
  • It can be extended to capture and store other URL parameters, as well.
  • You can also customize the amount of time before the cookie expires if you want.
  • It automatically fills in your hidden UTM form fields, even if those fields are not added to your form configuration.
  • And hey, it’s free!

 

Curious what you’ll do once you’ve captured these UTM parameters?  Read the fourth post in this series: How to Stamp UTM Parameters on Salesforce Campaign Members >

Sponge | Marketing & 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.

Sponge | Marketing & Revenue Ops

Download Resource

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