We'll be with you in a second

100+ templates for affiliate networks

Parameters/UTMs: show on a page

Estimated reading: 2 minutes

Why?

You can use additional parameters on your lander to improve your page performance and make it more personal for a visitor. For example, show the city information based on the actual city of the visitor. RedTrack has a list of supported dynamic parameters available for that purpose. If you need to receive some additional information on your Landing page, you can add these macros to your lander’s URL.

How?

1. Use the desired macro in your landing page URL, and we will identify it on the page. Let’s use city as an example for this guide. Example: https://landingpage/?city={city}

The list of other supported parameters is here.

2. Put the script into your page code.

<script type="text/javascript">
var parameterName;
function getParameterData(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 decodeURI(pair[1]);}
}
"return";
}

parameterName = getURLParameter('city')
</script>

3. Put another script to your page where it is supposed to place the dynamic value from the URL:

<script>document.write(getParameterData('city'))</script>
The “city ” parameter was used as an example, instead, you can use any of the parameters available in RT.

If you need to show several different parameters, add this line again:

<script>document.write(getParameterData('city'))</script><script>document.write(getParameterData('sub6'))</script>
Since we use the parameter “city ” here, the script will take the dynamic value for the city from the LP URL and place it on your page. 

Here’s how it might look on a page: