How to pull query string in to a data field in Marketo

Nichole_Cunnin4
Level 4

How to pull query string in to a data field in Marketo

We are trying to do some reporting on query string mediums that are used and I am running in to some trouble getting the data to transfer to a field in Marketo.

I am trying to use tokens to pull in the query string that we are using on URLs in to a data field. I have tried a lot of different triggers, but they are not pulling in the entire URL.

This is the URL I am testing and I am trying to see the query string data too, but it is only bringing over Winshuttle.com.

I am wanting to see this entire URL: https://www.winshuttle.com/?utm_source=ASUG&utm_medium=Referral&utm_campaign=Infographic and not just Winshuttle.com

These are the tokens that I've tried:

{{trigger.Web Page}}

{{trigger.Name}}

{{trigger.Details}}

{{trigger.Link}}

{{trigger.Referrer}}

{{trigger.Search Query}}

Have any of you dealt with this situation before?

6 REPLIES 6
Chris_Wilcox
Level 9

Re: How to pull query string in to a data field in Marketo

Hi Nichole,

Can you describe your use case a bit more for me? If you're just trying to do reporting, why wouldn't you use something like GA?

If you're trying to use them as a part of the trigger (e.g. - When someone visits the webpage via medium=Referral > send trigger alert), you could put that on the trigger filter, then just write your alert description using the reason why the alert is being sent.  Trigger with querystring constraint is pictured below for your reference.

marketo-example.png

Does this approach do what you need? If you need straight up reporting on volume, etc., you'd be better off doing that through a web analytics tool.

Thanks!

Chris

Nichole_Cunnin4
Level 4

Re: How to pull query string in to a data field in Marketo

We have FCI and are trying to implement this: Tracking UTM Parameters with Field Synchronization - Full Circle Insights . However, since Marketo can't write to the campaign member, we are trying to write to some field on the lead or contact record. I am not finding an easy way to do this. I also have a ticket in to FCI to see if they know of a workaround for doing this and a ticket in to Marketo support.

Chris_Wilcox
Level 9

Re: How to pull query string in to a data field in Marketo

Ahhh that makes sense. Ok so question, do you want to write the UTM parameters onto the record every time the contact visits the website (so it effectively becomes most-recent query string values), OR just the first time it happens?

My thought is... if you know your various combinations of UTM codes, you could have trigger campaigns for each UTM field that write the value to a field, but you'd have to have a campaign per UTM field, per possible value.

In other words, if you're running utm_medium=email, utm_medium=display and utm_medium=referral, you could have a trigger campaign watching for page visits with any of those three values with a flow step to Change  Data Value of utm_medium to "Email" for those that flow through the email campaign, etc.

I would imagine that would be cumbersome to maintain and allow for a lot of human error, but just trying to think of a creative solution for you.

Nichole_Cunnin4
Level 4

Re: How to pull query string in to a data field in Marketo

That makes sense and I see how that is a possible solution! I really appreciate the idea and think it is a great approach if FCI can't give me a good workaround. Thank you so much for the help!

SanfordWhiteman
Level 10 - Community Moderator

Re: How to pull query string in to a data field in Marketo

You're not wrong to expect something called {{Trigger.Web Page}} to contain the query string as well as all other parts of the URL. Unfortunately, in Marketo-speak, the "Web Page" comprises the hostname + pathname + hash of the URL, but not the query string.

I wrote up a workaround a long time ago to transport the query string into the {{Trigger.Web Page}} for more granular action: https://blog.teknkl.com/url-query-string-in-visit-web-page-triggers/

Dan_Stevens_
Level 10 - Champion Alumni

Re: How to pull query string in to a data field in Marketo

There is no such token.  As Chris mentions, this works best when analyzed with GA.  Actually there is one token that will take the value of the search field (your native search field on your website) as long as that value is part of an "s" url parameter (thanks Sanford Whiteman​).  This value is captured in the {{trigger.Search Query}} token.  For example, if the url looked like this: http:www.yoursite.com/?s=fast-cars, you can grab the "fast-cars" value using a CDV flow step:

pastedImage_0.png

More information can be found in Sanford's comments in this earlier thread: Re: Capturing Lead Source Using UTM Fields

The other way to capture the UTM parameters is if a form sat on the landing page.  You can capture each of the UTM parameters in hidden fields and those values would then be included within the lead record of that person.