JS Dynamic Query String Insertion

waffles

New member
Dec 8, 2009
12
0
0
I am trying to do some dynamic query string insertion on one of my LPS i found this guide here that I am working with

Netlobo.com | Get URL Parameters Using Javascript

I have this code in my header

Code:
<script language="JavaScript">
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
</script>

and then in the body of my LP i have this
Code:
<script language="Javascript"> t202kw_param = gup( 't202kw' ); </script>


so when a user clicks on my tracking link for propser , they land on my page and the url looks like

http://example.com/landingpage/?t202id=967&t202kw=google.com

but when the page is displayed the t202kw variable does not show up on the page, I know this is not an uncommon practice to use on LPs , so if anyone can help me out I would appreciate it, I have tried viewing the page on both chrome and firefox ( i am on linux so I do not have IE installed) and the issue happens with both browsers
 


First guess: Make sure you include that JS one-liner right at the end of your code - just before the </body>.