Can someone tell me how to do a simple redirect from a blog?

Discussion in 'HTML & Website Design' started by zehlendorf, Jul 6, 2007.

  1. #1
    Please help me, I just need to do a simple redirect from one site to another automatically. I want to redirect from a blog to an affiliate site so I can track how many visitors visited that aff link. Is this possible? If so, how can I do it? Thanks.
     
    zehlendorf, Jul 6, 2007 IP
  2. metalstein

    metalstein Well-Known Member

    Messages:
    660
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    110
    #2
    you can use this code

    <head>
    <meta http-equiv="refresh" content="1;url=http://www.domain.com/">
    </head>
     
    metalstein, Jul 6, 2007 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Probably you don't want/need that kind of redirect. Because you'll lost your visitors.
    - Do you have Google Analytics on your blog ? If yes with a simple javascript attached on your affiliate link you can make a nice tracking function (to check from Google Analytics).
    - Do yo have some Database on your server ?
     
    ajsa52, Jul 6, 2007 IP
  4. zehlendorf

    zehlendorf Member

    Messages:
    93
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #4
    Please let me know what that javascript is, I do have Google Analytics.
     
    zehlendorf, Jul 7, 2007 IP
  5. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #5
    You need something like this:
    
    <html>
    <body>
    <a href="url_to_your_affiliate" 
       onclick="reportToGoogleAnalytics('myClickedAds/affiliate01');"
       target="_blank">Text Link to your Affiliate
    </a>
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
    <script type="text/javascript">	
      _uacct = "UA-XXXXXX-X";	
      urchinTracker(); 
      
      function reportToGoogleAnalytics( reportedUrl )
      {
        if (typeof urchinTracker == 'function') 
        {
          urchinTracker(reportedUrl);
        }
      }  
    </script>
    
    </body>
    </html>   
    
    
    Code (markup):
    On the code above you need to use your own _uacct value and change the 'myClickedAds/affiliate01' variable with a path suitable for you (must not exist on your site).
    As a guide you can take a look at this article for tracking AdSense Ads, but works on affiliate ads too.
     
    ajsa52, Jul 7, 2007 IP