Home > Paid Traffic Sources > POP / PPV / Redirect

Altering Your Dynamically Inserted Keywords (3)


07-13-2011 11:23 AM #1 Gonzo (Member)
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.....so 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 bmw.com, but instead of saying "Dear bmw.com 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.

Code:
function gup( name )
{

//Enter target urls, followed by what you want displayed
var targets=new Array(
"saab.com","Saab",
"volvo.com","Volvo",
"bmw.com","BMW",
"ferrari.com", "Ferrari"
);


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

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:

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

Good luck bros.


07-13-2011 11:35 AM #2 ppvnewbie (Member)

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

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


07-13-2011 12:33 PM #3 Gonzo (Member)

Ya then you would just get the keyword, correct. So it would be "welcome site.com 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.


Home > Paid Traffic Sources > POP / PPV / Redirect