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).
Let’s say you are advertising the following page via radio ads:
This page actually redirects to the page below
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:
Rather than 301 redirecting to:
The 301 redirect should actually redirect to:
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.
Make sure your analytics tracking is on your redirecting page, before the script to run your redirect. So on this page:
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).
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.
Hi Chris, thanks for your interesting post. I have the following questions which I hope you can help me out with:
1. How do I track which outbound links (anchor text link, image link etc.) on my exit page leads the visitor to leave my site?
2. So far I have only used GA to track the number of visitors to my site. Now I would like to track the number of conversions (sales of affiliate offers) using GA. How is the conversion tracking possible when I can’t place the GA codes on the success page of the affiliate offer?
Thanks for visiting and for the great questions!
1- You can track outbound links using the EventTracking function in Google Analytics. You can read how to do this on a previous post.
Track Redirects in Analytics – How to Track a Redirect in Analytics
2- In regards to tracking affiliate activity, I assume you are asking how to track outbound activity (meaning you are on the publisher side)? Generally this is worked out through the affiliate network medium. For example, Commission Junction uses a tracking pixel to track transactions coming from publisher websites. All of the reporting is handled through Commission Junction’s reporting interface.
3- I would only try something like this if you are unable to track using an affiliate network. There are some ways to track conversions on 3rd party shopping carts, but this may prove difficult if you are using redirects to drive visitors to other websites.
I hope this helps.
Chris, thanks so much for answering my questions. I have gone through your post titled “Track Redirects in Analytics – How to Track a Redirect in Analytics”. It raised up other questions for me. The outbound link that leads a visitor to leave my site isn’t really an outbound link in the sense that it is actually a php file on my website with a header redirect which only contains my affiliate link. Assuming that the affiliate network has my tracking pixel set up:
1. Will EventTracking still be working fine in this case so that conversion (sale) can be tracked properly and viewed in my GA account?
2. How should the outbound link look like in the above-mentioned situation in which the link isn’t a “real” outbound link? Is it something like this:
3. Should the redirect php file contain any GA code in order to make EventTracking work?
Sorry, I think comment was converted into rich text format. Here is the code for question #2 again:
Hi again Chee,
_uacct = “UA-5*****-*”;
i pasted what i have on the redirect page.
is there anything i can do to keep the redirect tracking consistent?
i noticed the entire paste did not display.
window.location = “http://www.website.com”
they are both in their own script tags with the GA script before and the redirect after.
Thank you for bringing this to my attention. I am in the process of testing this using a delay in the redirect (vs a control version that contains no delay), to see if that makes a difference. I will let you know what I find.
Once again, thanks for bringing this to my attention.
I just posted a followup regarding your find.
Great post here. Thanks for sharing. One question though.
I am using a vanity url in an email campaign that looks like this: http://www.mysite.com/joinme?utm_source=google&utm_medium=cpc&utm_campaign=Content
This vanity url redirects to this page: http://www.mysite.com/register.jsp
The problem is, when someone clicks on the vanity url and goes to http://www.mysite.com/register.jsp, none of the UTM tags in the tagged vanity url are present. They’re missing, so nothing is getting tracked. All I see in the address field is http://www.mysite.com/register.jsp.
Also, if this same vanity URL is being used on my Web site, will the UTM tags appear in the URL if someone clicks on the link from the Web site?
What do I do?
The tracking parameters need to be added to the resulting URL, not the one redirecting to the resulting URL.
In other words,
Should redirect to
I hope this helps.
I just made a post about how to do this.
Hi. I am hoping you could help me. I want to track a link from an email to an external link. Is this possible? Do I need to set up a page on my website that will redirect to the external to get a rough estimate of how many people actually clicked on the original email link? Thanks for your time and help!
In order to track email clicks in Analytics you would indeed have to make sure the links pointed to a page that runs your analytics script. So either the links themselves would have to be your pages, or as you stated, they would need to redirect.
Also, I’m not sure what you mean by email. In the event you weren’t referring to a personal email but rather an email marketing campaign, then it’s possible the software you’re sending from (assuming you’re using software) tracks these clicks.
I hope this helps.
Please advise i have a domain called http://www.vtp.co.za but gets redirect to http://www.virtualtours360.3.co.za—the virtual tours 360 domain has google analytics setup will it track or registered on google analytics if there is redirect coming in from http://www.vtp.co.za ? Will its register as a hit or visit if the user got redirected from http://www.vtp.co.za to http://www.virtualtours360.co.za ? ?
Hey Johann – In that case, I believe it will show up as a direct visit on the virtualtours360 GA account.