utiq
utiq

Reputation: 1381

Track google analytics short-url redirection

for example I have a short-link manager that redirect to other page (I will call this destination page) and is like bitly http://myredirector.com/343uj

<html>
<head>
    <meta http-equiv="refresh" content="0;url=http://destination-page.com">
</head>

<body>
You are being redirected to <a href="http://destination-page.com">Destination Page</a>...
</body>
</html>

My problem is when I see the Analytics report of http://destination-page.com the pages procedences there are not registered from my short-link manager (http://myredirector.com)

Upvotes: 2

Views: 2556

Answers (2)

utiq
utiq

Reputation: 1381

I was investigating, now I am using the javascript document.location.replace(url) and the analytics is tracking the redirections from my http://myredirector.com/343uj

Upvotes: 0

Eduardo
Eduardo

Reputation: 22832

Most url shorteners will redirect using an HTTP 3XX status code. It means that the browser follows the redirect to the new path but keeps the same HTTP Referrer as before.

The HTTP Referrer is an HTTP field that is passed on every request indicating the previous page the user was in. This is also available through javascript using document.referrer.

Google Analytics (and other Web Analytics tools) will use the document.referrer property to set traffic sources. Since the redirect using HTTP keeps the Referrer the shortner is pretty much invisible to Google Analytics.

You didn't specify which url shortener you used, you just said it was "like bit.ly". I know that both bit.ly and goo.gl provide some statistics. If you just want to measure how many times people click on the link or some other basic info it should be enough. You just need to add a plus sign to the end of the link to see the stats.

eg:

If you want that information in Google Analytics you can use campaign parameters in the original url and minify it after you inserted the campaign parameters. With campaign parameters the referrer is ignored by Google Analytics and it will use those parameters to set the campaign source.

More information about Custom Campaigns in Google Analytics:

http://support.google.com/analytics/bin/answer.py?hl=en&answer=1033863

Upvotes: 2

Related Questions