# Migrating from Legacy Domains to the Dedicated Domain: Updating a Landing Page

While updating your setup to be able to use a Dedicated Domain, it might be necessary to make changes on your landing pages. You should always keep in mind that all Voluum URLs embedded there need to match the domain used in the campaign URL.

While doing so, it is a good idea to change it in a way that will allow you to use multiple different domains with the same landing page. It might happen that there is one landing page with different campaigns pointing to it. You can achieve that with a simple JavaScript code snippet.

###### I. Update the Lander URL

First of all, you need to update the lander URL by adding the Voluum {trackingdomain} token to it. To update the lander in the Voluum platform, perform the following steps:

1. In Voluum, go to Landers. The Landers view will show up.

2. Select and edit the lander you want to update. The lander's form will show up.

3. Go to the Lander URL field and verify tokens used in the URL: You need to add the {trackingdomain} token with a corresponding parameter to make your setup much easier in terms of setting up the correct domain.

The {trackingdomain} token and the adequate piece of code pasted on the landing page ensure that correct domain name will be automatically assigned to the URLs once the visit happens because the domain parameter will dynamically pass on the domain name for each visit.

The piece of code that you need to add to your landing page is provided in the section of this article.

### Note

Voluum Info: To dynamically inject data to the landing page, you might also add other tokens to the URL. You can add a variety of tokens depending what kind of the data you want to pass to the landing page.

Example:

Below you can see a simple example of the lander URL:

http://lander_url.com/?m1={model}&domain={trackingdomain}

where {trackingdomain} and {model} are Voluum's tokens.

When you add the parameter with the {trackingdomain} token, the system will replace the token with a domain that was used for the visit depending on which domain was used in the campaign URL.

4. Click the Save button to update the lander in Voluum. Next, you need to modify your landing page.

###### II. Update Your Landing Page

In this step you need to modify the landing page's HTML, so that all the data is automatically taken from the lander URL and used to build the click URLs on the landing page.

Within the <head>; section of your landing page, add the following script:

<head>
<script>
function getURLParameter(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] === name){return pair[1];}
}
return "";
}
</script>
</head>

where:

getURLParameter: This is a function that looks for a given parameter name in the landing page URL and returns its value.

Parameters in the URL are added as follows:

http://lander_url.com?parameter1=value1&parameter2=value2&parameter3=value3...

thus the getURLParameter (parameter2) returns the value2 and getURLParameter (parameter3) returns the value3.

Having defined the function, you can now use it in your CTA links / buttons. Let's assume that you have a very simple CTA link on the landing page: <a href="http://your_Voluum_legacy_domain.com/click">Click here to win!</a>

To make it use the domain passed to the landing page URL, change it to:

<body>
.
.
.
<script>document.write('<a href="http://'+ getURLParameter('domain') + '/click">Click here to win!</a>')</script>
.
.
.
<body>

where domain is the parameter used in the lander URL that dynamically passes information on the domain name for each visit.