: What kind of redirect (301 or 302) for an email links tracker? We are developing an email sending application ("à la" Mailchimp). Hyperlinks inserted by our users, in the emails they want to
We are developing an email sending application ("à la" Mailchimp). Hyperlinks inserted by our users, in the emails they want to send, are replaced by a tracking URL on our application (https://ourdomain.com/trackingurl?blablabla) which then redirects the email reader to the original URL our users included in their emails. This allows us to record statistics about link clicks.
Until now, we used 301 for those redirections, but we noticed that Google began indexing pages on our application which are in fact redirects to other domains. (The title and snippet in Google results are from the other domain, but the link in green is from our application). We took action by adding those urls to our robots.txt, but Google seems to take forever (months!) before removing them for its index and removing them by hand in Webmaster Tools would take a lot of time since there are lot.
I would like to know which kind of HTTP redirect (301 or 302) is best suited for this kind of opreation ? Do you think switching to 302 redirects could improve this situation since we don't really want Google to index redirected links from our clients emails ?
More posts by @Chiappetta492
2 Comments
Sorted by latest first Latest Oldest Best
I actually ended up adding X-Robots-Tag: noindex, nofollow in my HTTP headers (plus the 301 redirects) which seems to clear up the issue of the redirects being indexed by Google.
Stephen your answer is correct when in comes to which kind of redirect to use, but to clear up the issue of the links being indexed, this solution is what I was searching for.
301 redirects are "permanent" and 302 redirects are "temporary". The links that you send out in your emails are not going to redirect to something different in a month when somebody looks back over their old email. Use 301 permanent redirects.
In addition, because they are permanent, Google is not going to index the redirecting URL, it will follow it and index what it is pointing to. With 302 temporary redirects, Google is less likely to assign value to what it is pointing to and might index the redirecting URL itself.
If Google is indexing your 301 redirects, the first thing to check is that they are crawl-able. Make sure they are not disallowed in your robots.txt file.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.