Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • Site 2 year,3000UsersMonthly,done vast link builds (In: I Want to Sell My Website)
  • Internal link structure (In: General Search Engine Optimization)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    There are 0 guests and 2 members in the forums right now.
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-05 07:14
    Edit Message Delete Message Reply to this message

    Hi all,

    I want to track how many people are clicking on links to external websites.

    I understand a good way to do this is by setting up redirect files and have them go via them. Then I can track the clicks through google analytics or whatever.

    I've researched various forums and found response.redirect should do the trick.

    I wrote (stole) the following code which is the entire code for a file I've called redirect.asp



    Code: [copy]





    I then linked to redirect.asp using a standard method
    CODE:
    <a href="http://www.mydomain.com/redirect/redirect.asp">external link</a>


    I checked my server and get the following error

    [Sat Mar 04 23:56:33 2006] [error] [asp] [15456] [debug] String found where operator expected at (eval 36) line 7, near "Redirect "http://www.google.com"" <-->
    [Sat Mar 04 23:56:33 2006] [error] [asp] [15456] [debug] t(Do you need to predeclare Redirect?) <-->
    [Sat Mar 04 23:56:33 2006] [error] [asp] [15456] [error] error compiling redirect.asp: Can't modify concatenation (.) or string in scalar assignment at (eval 36) line

    What am I doing wrong?

    Please help,
    Thanks Travis



    Dinkar
    Staff
    Joined: Aug 12, 2001
    # Posts: 4391

    View the profile for Dinkar Send Dinkar a private message

    Posted: 2006-Mar-05 19:23
    Edit Message Delete Message Reply to this message

    delete all HTML and try again.



    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-06 07:21
    Edit Message Delete Message Reply to this message

    What do you mean? Delete the file and create a new one? I've tried both a .asp file and a .htm file and neither have worked.



    g1smd
    Staff
    Joined: Jul 28, 2002
    # Posts: 10440

    View the profile for g1smd Send g1smd a private message

    Posted: 2006-Mar-06 12:05
    Edit Message Delete Message Reply to this message

    The Header that you are trying to output is the HTTP header.

    The HTTP header goes ABOVE any HTML on a page (just like the To and From header in an email is above the message body itself).

    So, delete all the HTML code you have there, and leave just the ASP code as that is all you need.



    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-07 04:39
    Edit Message Delete Message Reply to this message

    Hi,

    Thanks for your suggestions but it appears not to be the problem.

    I had it back to the basics before and it didn't work then. I've tried just



    Code: [copy]





    With and without a Semicolon at the end.

    and also



    Code: [copy]





    I've just tried those again and it still doesn't work. The error I am getting in my browser is

    "Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request."

    The details from my log are the same as above.

    I've recently obtained a Virtual Dedicated Server and I'm still trying to get to grips with it all. But according to my settings in Plesk I have Apache ASP Support for this domain.

    I'm thinking now it must be an error in how Apache is installed on my server. What does Apache ASP support actually mean? Is it a programming language compiler that needs to be installed on the server to run asp code?

    Is there a simple html equivalent that I can use?

    Apologies for my perhaps stupid questions but I'm fairly new to web related programming and servers.

    Thanks
    Travis



    Dinkar
    Staff
    Joined: Aug 12, 2001
    # Posts: 4391

    View the profile for Dinkar Send Dinkar a private message

    Posted: 2006-Mar-07 06:22
    Edit Message Delete Message Reply to this message

    It is somehow related with file/folder permission. Check your hosting control panel for similar option. You need to allow script access permission or something similar.



    Prowler
    Staff
    Joined: Aug 14, 2000
    # Posts: 1795

    View the profile for Prowler Send Prowler a private message

    Posted: 2006-Mar-07 07:15
    Edit Message Delete Message Reply to this message

    Some times it could be the implementation. Try this:


    Code: [copy]




    This code needs to be at the top of the page as the server sends out a 302 redirection.

    As your server is Apache, why do you restrict yourself to the non-native ASP code for this server ?
    You could try PHP or a CGI script which will write out a log file in addition to doing the redirection.




    Dinkar
    Staff
    Joined: Aug 12, 2001
    # Posts: 4391

    View the profile for Dinkar Send Dinkar a private message

    Posted: 2006-Mar-07 07:29
    Edit Message Delete Message Reply to this message

    Yep, I missed that damn ().



    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-07 11:54
    Edit Message Delete Message Reply to this message

    As your server is Apache, why do you restrict yourself to the non-native ASP code for this server ?
    You could try PHP or a CGI script which will write out a log file in addition to doing the redirection.


    The simple answer to this is I'm an idiot and I don't know what the frak I am doing.

    I chased it up with my service provider and they told me I don't have asp support (even though there's a tickbox to suggest I have it).

    I've created a php file with the code


    Code: [copy]





    and it works fine.

    Thanks a lot for your help.

    Travis



    g1smd
    Staff
    Joined: Jul 28, 2002
    # Posts: 10440

    View the profile for g1smd Send g1smd a private message

    Posted: 2006-Mar-08 02:05
    Edit Message Delete Message Reply to this message

    That code is for a 302 redirect. You do not want that.

    You need to add another line that says it is a 301 redirect.

    The 302 redirect will cause you a lot of problems in Google.



    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-08 03:03
    Edit Message Delete Message Reply to this message

    OK thanks,

    I changed it to



    Code: [copy]







    hex74726176
    Joined: Oct 28, 2004
    # Posts: 57

    View the profile for hex74726176 Send hex74726176 a private message

    Posted: 2006-Mar-10 01:01
    Edit Message Delete Message Reply to this message

    Google Analytics specific solution.

    Hi,

    Here's a final solution for those who come across the same problem.

    I was still having problems since using Google Analytics you need to add a small piece of script at the bottom of each page to be tracked.



    Code: [copy]





    Where the X's indicate your account number. Doing a 301 redirect this script never gets to be read.

    The solution of tracking outbound links doesn't involve redirects at all.

    Here's the solution.

    Google Analytics: - How do I track clicks on outbound links?


    Cheers,
    Travis


    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions