How do I mask my affiliate URL?

Discussion in 'Affiliate Programs' started by NewIQ, Oct 8, 2007.

  1. #1
    Hey all:

    I read that you can mask your affiliate ID/URL with a PHP script...can someone give me detailed instructions on how to do this? For example what would the script look like to make:

    http://affiliatelink.com

    show:

    http://companyurl.com

    when rolled over and clicked on? If anyone could answer this, I'd be really grateful! Thanks

    P.S. I'm not really interested in the simple mouseover.
     
    NewIQ, Oct 8, 2007 IP
  2. orange

    orange Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ok, here is the way I'm doing that on my sites. The first step is to create a new .php file and name it something like "link.php" or whatever you want. You have to add the following code. You can modify the 'sign-up-1' to whatever you want to show for the link.
    Insert your affiliate link where it says: h t t p://affiliatelinkage.com

    PHP Code:
     <?php
    
    $path = array(
    '[COLOR="Red"]sign-up-1[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //Top Image Ad
    '[COLOR="red"]sign-up-2[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //Banner Ad
    '[COLOR="red"]sign-up-3[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //1st H1 title
    '[COLOR="red"]sign-up-4[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //Text ad sign up
    '[COLOR="red"]sign-up-5[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //2nd H1 title
    '[COLOR="red"]sign-up-6[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //3rd H1 title
    '[COLOR="red"]sign-up-7[/COLOR]' => '[COLOR="red"]http://affiliatelinkage.com[/COLOR]', //bottom text ad
    );
    
    if (array_key_exists($_GET['id'],$path))
        header('Location:'.$path[$_GET['id']]);
    ?>   
    Code (markup):

    For each link i use I add a seperate tracking/subid to it so I know what link was click & where conversions come from.

    Now your links will look like this:

    <a target="_blank" href="http://www.yousite.com/link.php?id=sign-up-1">Click Here To Get Yours Today!</a>

    So all you need to do is change what is in red to the name of your link that you gave it in the link.php file

    link.php?id=sign-up-1

    Hope this can help. :)
     
    orange, Oct 8, 2007 IP
  3. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #3
    you can do php redirect or htaccess redirect.
     
    MeetHere, Oct 8, 2007 IP
  4. NewIQ

    NewIQ Peon

    Messages:
    165
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Awesome, this looks great! So do I just FTP that link.php file into httpdocs? Do I have to do anything else?
     
    NewIQ, Oct 8, 2007 IP
  5. NewIQ

    NewIQ Peon

    Messages:
    165
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'm not sure I understand the part where you say:

    "So all you need to do is change what is in red to the name of your link that you gave it in the link.php file"


    Here's what I have now:

    <?php

    $path = array(
    'http://www.###########' => 'http://affiliates.############', //Top Image Ad
    );

    if (array_key_exists($_GET['id'],$path))
    header('Location:'.$path[$_GET['id']]);
    ?>

    It has been renamed links.php and FTP'd over to httpdocs. Am I missing a step?
     
    NewIQ, Oct 8, 2007 IP