Capture UTM parameters from an url (w/o going through a form)

Cecile_Maindron
Level 10

Capture UTM parameters from an url (w/o going through a form)

Hello,

I can already hear some of you screaming "there are tons of discussions on UTM parameters, search the community first". I know there are many discussions out there, I contributed to some and I have looked for an answer on community, I swear! Either I am blind (or I didn't understand everything) but I couldn't find what I was looking for.
We have a TY page post download (without form) and I wanted to know if it was possible to capture the utm parameters on TY page to identify a successful conversion from paid search. In other words, can I say if url contains utm_medium=cpc, change data value on medium field and add the value in url?

I have found the following .js and I was wondering if this could be the answer: Get URL Parameters via JavaScript on a Marketo Landing Page  (I'm not a web developer).

Ideally I would like a solution that doesn't require to be a web developer (i.e. to know .js or .php)

thanks

Cécile

2 REPLIES 2
Anonymous
Not applicable

Re: Capture UTM parameters from an url (w/o going through a form)

Hi:

I have done this via JavaScript in the past.  I don't know of any other way to add the utm value to the url.

One thing to know is that you may not need to do this.

in market you can filter on webpage visited, one constraint on that is querystring.  So if you use your utm code in the querystring constraint you can then understand what paid search ad they clicked.

The example is

visited web page X, with constraint querystring contains utm_medium=cpc

I hope this helps you.

PS  When you configure your paid search ads you can have them contain the utm values by default so you may be able to skip the javascript based on how you configure the ad to begin with.

SanfordWhiteman
Level 10 - Community Moderator

Re: Capture UTM parameters from an url (w/o going through a form)

Marketo isn't equipped for query string parsing on the back end (with one particular exception that is not applicable here).  If you have a set of query string parameters, you would have to list all possible values for every param in order to change the data value in a Flow step.

However, Marketo does have a query string parser and lead field updater on the front end: Marketo Forms.  You may not think of them that way, but even without visible fields, forms can parse out values from the current query string, and in turn write them to lead fields.  So what I would strongly recommend here is Make a Marketo Form Submission in the background.  The lead does not see the form, but it will update all the matching fields automatically.