Altering Your Dynamically Inserted Keywords

I saw this question asked in another thread so I went looking for the answer because I thought it could be useful. I still haven’t got it working right, but it’s 7am in Texas and I haven’t slept left and have a lot more shit to do before I can sleep… I’ll just get to it later.

Here’s what I found, I’m sure yall can improve on this:

Here is a script to customize your lp copy based on the keyword/target url.

eg: Lets say you pop on, but instead of saying "Dear Visitor", you can say "Dear BMW enthusiast!".

Not the most elegant code, and it can be a pain to set it up when you have hundreds of targets, but it works.

Put this into a separate js file and call it from the lp.

function gup( name )

//Enter target urls, followed by what you want displayed
var targets=new Array(
"", "Ferrari"

name = name.replace(/[[]/,"\[").replace(/[]]/,"\]");
var regexS = "[\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";

var len=targets.length;
for (i=0; i<len; i++)
if (results[1]==targets[i])
return targets[i+1];
else i++;
return results[1];


Put this in your lp, where you want it to be displayed:

<script language="JavaScript">document.write(gup( 'target' )) ;</script>

Good luck bros.

User Comment:
Holy cow, so much code for this? Glad I am using cpvlab and only need this code:

<?php echo($_GET["target"]) ?>

User Comment:
Ya then you would just get the keyword, correct. So it would be "welcome visitor!" This should allow you to change it to "Welcome site visitor!" …or whatever other variation. Like I said, I’m not implementing until tomorrow, but that’s how I understand it.

The Article Published IN 07-13-2011 11:23 AM

Share To More ()