I have a DotNetNuke website (hosted on IIS server), and most of my urls are very long. We have PDFs posted of our products, and we set up some shortcut urls for convenience that redirect using a meta refresh redirect. I recently read that these links will not be added to Google's index and can be considered "spammy". Also, these redirects are preventing Google Analytics from tracking these page views.
An example shortcut url we have set up is: mysite.com/awesomesauce
This would redirect to the PDF brochure of that product: mysite.com/products/sauces/awesome_sauce.pdf
I would like to add Google Analytics tracking to track when people access or click on the shortcut url link (mysite.com/awesomesauce). Is there a way to track access to this shortcut link that also avoids the "spammy" meta refresh method?
I considered putting some JavaScript at the bottom of the page:
<script>
// Google Analytics tracking code, etc.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// Redirect code (after tracking events fire)
window.location = "http://mysite.com/products/sauces/awesome_sauce.pdf";
</script>