Writing Language URL Parameter to Lead/Contact Record

Troy_Larson
Level 3

Writing Language URL Parameter to Lead/Contact Record

Hi all - 

 

So I have a language parameter in our URLs. For example, ?lang=fr . I also have a Preferred Language field in Marketo. What I'd like to do/curious about how to do this, is take that URL parameter and incorporate some logic to write that field. 

 

I know I can create a campaign that looks for people who :visited any web page with querrysting containing ?lang=fr" but that only works for "known" people. 

 

Any tips on ways to do this for anonymous people? Or ways to basically make it functional at a more global level. 

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Writing Language URL Parameter to Lead/Contact Record

Only with 2 things:

 

  • JS to transplant that value into the hash, so it'll be part of what Marketo considers the "Web Page" for token purposes 
  • a webhook-compatible service to parse the value out and return it to lead field

We have this type of thing running in a few places.

Troy_Larson
Level 3

Re: Writing Language URL Parameter to Lead/Contact Record

Hey Sandy - 

 

Thanks for the tip. So, if I were to go to JS route, I would put that in the page template and I could then get it to populate my Preferred Language field with a value from a pick list, correct?

SanfordWhiteman
Level 10 - Community Moderator

Re: Writing Language URL Parameter to Lead/Contact Record

Oh, those 2 bullets have to be used together. The JS is to get the value explicitly into the {{trigger.web page}}. The hook stamps that onto a field value.

 

However, we may not be looking at the wider picture yet. An anonymous Web Page Activity report can show anonymous leads by (hard-coded, to be fair) language parameter. What exactly are you looking to do — report, trigger, set a value, etc.?

Troy_Larson
Level 3

Re: Writing Language URL Parameter to Lead/Contact Record

Investigating dynamic landing page content. Basically setting up a Preferred Language Segment & then using that to populate a Landing Page Snippet so that I have 1 landing page but the content is in like 5 different languages. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Writing Language URL Parameter to Lead/Contact Record

If it's just 5 languages, create the Segmentation ("lang") and the 5 Segments.

 

Are you concerned about the case where someone returns to the page and doesn't have the query param? Little confused about why you wouldn't just use the query param directly.

Troy_Larson
Level 3

Re: Writing Language URL Parameter to Lead/Contact Record

I'm thinking about anonymous / unknown people. So if I'm unknown and enter then I wouldn't fit into a segment and the minute I click off our WordPress page to a Marketo page my segment would be "default" and I'd go from my language to english (as that's the default). I'm trying to create an experience where they continue to a Marketo LP that is in their own language. That clear it up a little bit?

SanfordWhiteman
Level 10 - Community Moderator

Re: Writing Language URL Parameter to Lead/Contact Record

If

  1. the page has ?lang=es in the query string
  2. the Segmentation is called "lang"
  3. the Segment for Spanish is "es"

they'll see the dynamic content for Spanish.