Link Cloaking with Javascript
This is the script I'm currently using to 'cloak' my affiliate links.
<script type="text/javascript">
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[[]/,"\[").replace(/[]]/,"\]");
var regex = new RegExp("[\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
var redirect_value = getQuerystring('a');
var websites = [
"MyAffiliateLink1",
"MyAffiliateLink2",
"MyAffiliateLink3"
]
if (redirect_value!="null")
{
window.location=websites[redirect_value];
}
</script> I'm wondering if this will be safe to use when it comes to using Clickbank/Neverblue/etc affiliate links. Safe as in the hit will still register and I would still get a commission for the sale if one were made.
Edit: The reason I ask is because Clickbank in particular does not have great tracking, so unless I'm misinformed, I can't see how many hits have been sent to my link
-
alucard001 -
Thanks
SignatureFree WSO - Learn How To Make Money Through Blogging, 4 Bonus Inside.{{ DiscussionBoard.errors[1656720].message }} -
-
Boomachucka -
Thanks
{{ DiscussionBoard.errors[1657655].message }} -
-
customertools -
Thanks
{{ DiscussionBoard.errors[1664738].message }} -
-
Srikanth D -
Thanks
Signature>> Getting back into IM game <<{{ DiscussionBoard.errors[1664825].message }} -