Oct
3
2008

Get More by Tracking URL Redirects

Well you’ve probably got a URL Redirect out there already, but are you tracking it? Why not? There is so much that you can learn and it can be quite simple, especially with Google Analytics and a little code.

The most common reason for a redirect is a “Short URL” this is merely turning a really long/confusing website address like www.dartmouth.edu/~alfund/ into something like www.dartmouthcollegefund.org. These are also known as a “Print URL” as they are much easier to “print” on publications or tell someone on the phone. Also a redirect can be used to help show partnerships with other programs like www.uclalumni.net/MasterCard.

Time to Start Tracking with Google Analytics:

Now that you have a redirect going to a page on your site and you are using Google Analytics, I recommend that you follow Karlyn’s Fast Tip Friday: Google Analytics URL Builder. Also check out Kyle’s Free Destination URL Builder and Tracking Tool. This is going to defiantly improve your knowledge on where they came from and what they accomplished.

Going one Step Further and Tracking External Links:

Wait we are not done yet; I’ve got one more URL Redirect type for you to track. How about we track those ‘partnership’ redirects. That is right we can and should track the www.uclalumni.net/MasterCard redirects so that we know what kind of traffic we are referring to our partners (albeit some will share that info). Since Google Analytics is not an option here we’ll have to switch to the Server Pages as I mentioned in the Making URL Redirects 508 Compliant post.

<?php
//Tracking the User First
$mail_body = “Redirect: “.$_SERVER[‘SERVER_NAME’].$_SERVER[‘REQUEST_URI’].”\n”.
“IP Address: “.$_SERVER[‘REMOTE_ADDR’].”\n”.
“Date & Time: “.date(“l, F, j, Y h:i:s A”).”\n\n”.
“Referer: “.$_SERVER[‘HTTP_REFERER’];

mail(“you@school.edu”, “redirect name”, $mail_body, “From: Redirects <redirect@school.edu>”);

//Redirect the User Next
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.draftmotif.org”);
?>

So there you have it now we can track all sorts of redirects both to our site and going to a partner site. Also, since I’m going to be writing a MySQL version of the above script soon if you’ve got tips, ideas or want a copy just let me know.

Now What? Stop and Think!

Having trouble thinking how you can put this to use (not a chance)? Before you print your next appeal or add a link like http://chancellor.uark.edu/13226.php to a magazine consider a “Short URL” and track it too. Got a TV advertisement running soon; why not track it and get a more accurate response rate. Also, visit Kyle’s post on Using Redirectors for Offline Campaigns for a list of Offline Campaign Types.

Happy Tracking Everyone!

  • Anarchist

    This page is throwing a Javascript error in IE on line 757

    It’s probably the \’\’, why not just use double quotes there? this.value=””

  • Anarchist

    This page is throwing a Javascript error in IE on line 757It’s probably the ”, why not just use double quotes there? this.value=””

  • draftmotif.org

    Anyone else getting this? I cannot seem to track down the problem. @anarchist if you’d like to send me more details I’ll try and track it down. I tried IE7 but it seems to work be working fine.

  • Anarchist

    It’s IE only within Lotus Notes 7 client that it throws the error, not sure what version of IE, although would assume system default, ie7. I had a similar thing on one of my pages last week, would only throw the error in Notes client. Probably not worth tracking down if my previously suggested fix didn’t do the trick.

    By the way, thanks for the tool, hopefully I can try it out further at a later point.

  • Anarchist

    It’s IE only within Lotus Notes 7 client that it throws the error, not sure what version of IE, although would assume system default, ie7. I had a similar thing on one of my pages last week, would only throw the error in Notes client. Probably not worth tracking down if my previously suggested fix didn’t do the trick. By the way, thanks for the tool, hopefully I can try it out further at a later point.

  • http://www.paulprewitt.com Paul Prewitt

    Anyone else getting this? I cannot seem to track down the problem. @anarchist if you’d like to send me more details I’ll try and track it down. I tried IE7 but it seems to work be working fine.

  • http://www.paulprewitt.com Paul Prewitt

    Anyone else getting this? I cannot seem to track down the problem. @anarchist if you’d like to send me more details I’ll try and track it down. I tried IE7 but it seems to work be working fine.

FREE Updates