This post is split into two sections. The first is for tracking your own internal redirects using Google Analytics. The second portion is for tracing URL redirect paths.
Tracking Redirects with Google Analytics
One of the problems people run into is their inability to track redirects in Google Analytics. For example, let’s say you purchase radio or print ads in order to advertise a product. Rather than simply advertising your domain name (ie (www.yourdomain.com), you may add an easy to remember folder name (ie. www.yourdomain.com/adpage), which redirects to the appropriate product page (which is probably too long and complicated to display on a radio, TV, or print ad).
Depending on the type of redirect you use, Analytics may not be able to track visits and user behavior. Fortunately, there are at least 2 ways you can track redirects. In both instances, you have to make sure the directory actually exists as a file (ie. /adpage/index.php). The difference lies in the type of redirect you use. If you use a 301 redirect, you’ll want to add campaign tracking to the url you are redirecting to, so Analytics can track visits as a campaign. The other option is to use a standard javascript redirect, and add the Analytics tracking to the redirecting page (ie. /adpage/index.php). This way, you can track visits and user behavior in the Analytics Content section.
Let’s say you are advertising the following page via radio ads:
www.yourdomain.com/adpage
This page actually redirects to the page below
www.yourdomain.com/long-url-product-page.php
Here are two ways you can track visits and user behavior for people landing on www.yourdomain.com/adpage.
1- Tracking 301 redirects with Google Analytics
Add campaign tracking to your forwarding page. So, on this page:
www.yourdomain.com/adpage/index.php
Rather than 301 redirecting to:
www.yourdomain.com/product-page.php
The 301 redirect should actually redirect to:
www.yourdomain.com/product-page.php?utm_source=yoursource&utm_medium=yourmedium&utm_campaign=yourcampaign
You will then be able to track the number of times www.yourdomain.com/adpage was visited by looking at your new Campaign (under Traffic Sources) metrics.
2- Tracking a redirect using a javascript redirect:
Make sure your analytics tracking is on your redirecting page, before the script to run your redirect. So on this page:
www.yourdomain.com/adpage/index.php
Make sure your analytics tracking code appears before your redirect runs. You will then be able to track the number of times www.yourdomain.com/adpage/index.php was visited by looking at your Top Content or Top Landing Pages (under Traffic Sources).
*** This method only works efficiently if you implement a time delay in the JavaScript redirect. Otherwise, the Analytics script won’t always finish running before the page redirects, and your Analytics reports won’t capture every redirect. Read more on this related post: Update on Tracking JavaScript Redirects
Tracing External URL Redirects
There are several reasons you may want to trace a redirect path or a URL. A faulty URL on your own site may be redirecting several times and you want to see the entire path. You may want to trace the entire path of an affiliate’s URL so see the entire path it’s taking. So here are a few free tools to trace and control redirects while browsing.
My favorite part of this tool is that it will list out entire redirect chain and display the URL that’s setting cookies. In the example below, this was used to expose certain tracking errors.
My favorite part of this tool is that you can enter multiple URLs at once, you can hover over the final 200 status icon and see some basic header information, and most importantly, the redirect source and destination URLs (the URL on the secondary domain) can be exported.
Unlike the other two, this one is a Chrome extension and works by tracing redirect paths of URLs you’ve actually browsed.