Forum Moderators: DixonJones

Message Too Old, No Replies

tracking visitor from PPC to affiliate site

passing URL parameters

         

SharonF

1:48 am on Feb 3, 2005 (gmt 0)

10+ Year Member



Hi, I'm using PPCs, and am passing the keyword the user used to find my ad to an affiliate site via URL parameter, i.e. [example.com?KW=keyword_phrase...]

That works fine when sending the user directly to the affiliate's site, because the site has a tool that grabs the keyword so I can find out what terms convert.

BUT, if I want to send the visitor to a landing page on my site first, the keyword information gets lost, or rather, I don't know how to capture it and pass it along when (if) the visitor clicks a URL leading to the affiliate site. How can I grab the parameter from the URL, then pass it to the affiliate site?

I'd appreciate any help - thanks!

Sharon

[edited by: Woz at 1:04 pm (utc) on Feb. 4, 2005]
[edit reason] examplified URLs [/edit]

SharonF

3:18 pm on Feb 3, 2005 (gmt 0)

10+ Year Member



Okay, I've figured out how to grab the parameter using some javascript I found somewhere:

<script type="text/javascript">
if (location.search.length > 0) {
launchString = location.search.substring(1, location.search.length);
var launchStringArray = launchString.split("&");
for (var i = 0; i <= launchStringArray.length - 1; i++) {
var left = launchStringArray[i].substring(0, launchStringArray[i].indexOf("="));
var right = launchStringArray[i].substring(launchStringArray[i].indexOf("=") + 1, launchString.length);
if (isNaN(right)) {
right = '"' + right + '"';
}
eval("var " + left + " = " + right);
}
}
</script>

Now, any ideas on how to put in a URL the user can click on, so it gets passed to the sales page?

Sharon