Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Tim_Madel1
Level 4

Using URL Parameters to Drive Dynamic Content on Landing Pages

We use Marketo for all of PPC landing pages and in Russia we need to tailor these landing pages to the different regions.  Most of the content on the page will stay the same, but we would like to regionalize with the regions name, city list and a map.  Instead of creating hundreds of variations of our landingpages we though we could create one set and based on URL parameters (i.e. pages.vj.com/landing.html?region=Moscow&cities=Moscow%20%Leningrad&map=msocow.jpg) change the content of the page.

I was thinking of using Program tokens but don't know if they can be dynamically set. 

Should I just use Javascript instead?

9 REPLIES 9
Grégoire_Miche2
Level 10

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Hi Tim,

Indeed, you will need to use some JS to do this. You will have to extract the info form the URL and then inject it in the page, on specific places (usually using classes or IDs to identify the places where to inject the data).

-Greg

Anonymous
Not applicable

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Program tokens can be dynamically set via API so that is an option.  The best way to do this is by making the Landing Pages dynamic via segmentation or via tokens. 

Grégoire_Miche2
Level 10

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Hi Jamie,

as we are talking here about PPC campaigns, the information is probably set by the banner or paid add on which the visitor has clicked, not form an email sent from Marketo (in which case we might also consider using lead tokens).

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

But you can still use segmentations, forcing the segment in the URL. I'd say this is probably easier for people who are used to the Marketo LP Editor experience.

Grégoire_Miche2
Level 10

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Agreed with the segmentation idea, yet Russia is by far geographically the largest country in the world and I am afraid the number of segments end up with being hard to manage, furthermore if one has to combine multiple criteria.

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Fair enough!  For complex permutations you'd have to use real scripting.  Could say segmentations are like SSI as opposed to a real templating/preprocessing language.

Robb_Barrett
Marketo Employee

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

You'll need to create or modify a page template to get the code in you need.

In your header of your template, you'll want this:

<script type="text/javascript">

function getUrlVars() {

    var vars = {};

    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,

    function(m,key,value) {

      vars[key] = value;

    });

    return vars;

  }

var map = getUrlVars()["map"];

var region = getUrlVars()["region"];

var cities= getUrlVars()["cities"];

</script>

Now, in your HTML, where you want the stuff to appear, put this in:

Map:

<img id="map-img">

      <script>

  var mapimg = map;

  document.getElementById("map-img").src = mapimg ;            

      </script>

Cities:

<ul id="itemList"></ul>

<script>

var itemsExist = true;

var indexNum = 0;

var unorderedList = document.getElementById('itemList');

var str = cities;

var res = str.split("%20%");

var myElement;

function write_cities() {

    for (i = 0; i < res.length; i++) {

        // Create the <LI> element

        myElement = document.createElement("li");

        // Add the letter between the <LI> tags

        myElement.appendChild(document.createTextNode(res[indexNum++]));

        // Append the <LI> to the bottom of the <UL> element

        unorderedList.appendChild(myElement);

    }

}

if (itemsExist) {

    write_cities();

}

</script>

Region:

<p id="Region-Name"></p>

      <script>

  var regionname = region ;

  document.getElementById("Region-Name").innerHTML = regionname;            

      </script>

Robb Barrett
Alok_Ramsisaria
Level 10

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Hi Tim, Yes, you can do this very easily by using the segmentation. Here are the example URL's http://info2.filemaker.com/FileMaker_Platform_Trial_Request.html?Language=EN http://info2.filemaker.com/FileMaker_Platform_Trial_Request.html?Language=FR In the above URL's content is regionalize on the basic Language Parameter and it setup using the segment only, if you want can use the tokens also with the segments. Let me know, if you need more info on this. Regards, Alok

Mike_Reynolds2
Level 10

Re: Using URL Parameters to Drive Dynamic Content on Landing Pages

Tim,

This can actually be done very easily with Real Time Personalization (RTP). It's a product that Marketo offers and the basic function is to dynamically change your page content depending on which visitors view the page. Using URL parameters is just one of a large number of ways you can identify audiences, but you can also use geo-location through reverse IP lookup, lead data integrated from Marketo and a wide variety of other options as well. Once the audience is identified you can create custom content for each audience, all within the same one page. So, you have one web page and unlimited ways to dynamically change the content on it. Talk to your Customer Account Manager and I'm sure they'll have lots of information available on RTP