Referrer Link?

Discussion in 'Programming' started by outbreak, Nov 30, 2011.

  1. #1
    Hello

    Here's my question:

    Let's say that I want to send traffic from my website to DigitalPoint and I don't want to put DigitalPoint's link on my site, but I would want that my site is shown as the traffic source when you look at DigitalPoint's Google Analytics (or any other tracking service).

    Would it look something like this?
    http://mysitegoeshere.com/ref=?digitalpoint
    Code (markup):
    How can I manage that?

    Edit: I am using WordPress
     
    outbreak, Nov 30, 2011 IP
  2. Adam Neal

    Adam Neal Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Take a look at PHP header function. Something like this should do what you're looking for:

    <?php
    
    if (isset($_GET['ref']) and $_GET['ref'] == 'digitalpoint')
    {
        header('Location: URL');
    }
    PHP:
     
    Adam Neal, Nov 30, 2011 IP
  3. outbreak

    outbreak Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As I don't understand PHP to much.

    I should host that file in the public HTML folder?
    And, how do I link the post from my blog with that file?

    Thanks.
     
    outbreak, Nov 30, 2011 IP
  4. Adam Neal

    Adam Neal Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, create a new file in your public web folder, usually public_html, with .php extension, say external.php. You'll then be able to access the link through yourdomain.com/external.php?ref=digitalpoint
     
    Adam Neal, Nov 30, 2011 IP
  5. outbreak

    outbreak Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the help.

    I heard Google doesn't like redirects and that I would have to change the .htaccess file.
    This will be ok in the eyes of Google?
     
    outbreak, Dec 1, 2011 IP
  6. Adam Neal

    Adam Neal Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not really, however, you may want to add nofollow:

    [COLOR=#000000][FONT=monospace]<a href="external.php?ref=digitalpoint" rel="nofollow">Link text</a>[/FONT][/COLOR]
    Code (markup):
     
    Adam Neal, Dec 1, 2011 IP