Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2008
    Posts
    133
    Thanks
    14
    Thanked 0 Times in 0 Posts

    How do I mask this affiliate link?

    Hi, my site contains many affiliate links and usually I simply link to them by using a php redirect. I.e. I have
    many folders (one for each affiliate program) containing an index.php file with the actual affiliate link and I
    just link to this folder. This is usually simple but now I have some links as below containing javascript
    and I don't want to break the tracking script. Can anyone tell me if I can do the exact same thing with this
    type of link? Thanks.

    Code:
    <script language="javascript" type="text/javascript">
    var myTarget='http://track.webgains.com/click.html?wglinkid=46986&wgcampaignid=67341&js=0';
    var uri = 'http://track.webgains.com/link.html?wglinkid=46986&wgcampaignid=67341';
    document.write('<a href="'+myTarget+'" target="_blank" onMouseOver="window.status=\'https://rec1.globalepanel.com/research/0903mskukedr/index.php?AID=lk2\';return true;" onMouseOut="window.status=\'\'"><img src="'+uri+'" width="120" height="60" border="0" alt=""/></a>');
    </script>

  • #2
    New Coder
    Join Date
    Oct 2009
    Posts
    23
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello,

    Please visit the following sites to see if they can help you out:

    http://www.tw3o.com/methods-to-mask-...filiate-links/
    http://www.ajmcclary.com/how-to-mask...ate-links.html
    http://forums.digitalpoint.com/showthread.php?t=99976

    Hope this helps!!!
    CoffeeCup.com

  • #3
    Regular Coder
    Join Date
    Apr 2007
    Location
    Griffith. Australia
    Posts
    138
    Thanks
    4
    Thanked 4 Times in 4 Posts
    One method commonly used is to create a javascript function, something like...

    Code:
    <script type="text/javascript">
    function PaintAffiliateLink() {
    var myTarget='http://track.webgains.com/click.html?wglinkid=46986&wgcampaignid=67341&js=0';
    var uri = 'http://track.webgains.com/link.html?wglinkid=46986&wgcampaignid=67341';
    document.write('<a href="'+myTarget+'" target="_blank" onMouseOver="window.status=\'https://rec1.globalepanel.com/research/0903mskukedr/index.php?AID=lk2\';return true;" onMouseOut="window.status=\'\'"><img src="'+uri+'" width="120" height="60" border="0" alt=""/></a>');
    };
    </script>
    With that function in a separate javascript file named something like affiliate.js you can include it on your page and everywhere you want that affiliate link to appear on your page you simply use the PaintAffiliateLink() function, if the end user looks at the source code all they will see is the paint function, they won't see the details on your affiliate link but just as a side note if you are wanting to hide the fact that it is an affiliate link and redirect the user so that they can't tell that it is hosted on Google AdSense for instance, double check the terms and conditions of your affiliate service because many of them have clauses which state you may not mask the URL or hide the fact that it is an affiliate link. Could result in your affiliate status being revoked.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •