Track Vanity URLs Using Redirects

Comments:23

  1. Hi Ana,
    I have a question here. Currently we have used links like http://www.mysite.com/name-of-campaign (such as email, kiosk, directmail) that all go to the same destination page. We can already get the destination, but how can we track which URL the users came through? Also, what are the mistakes to avoid (what is bad practice/to definitely avoid)?

      1. Hi Jonathan! Unfortunately I don’t exactly understand the question. Do you mean you have links like mysite.com/email, mysite.com/kiosk, etc, that all redirect to the same URL (say, mysite.com) so you want to be able to distinguish them? If so I’d suggest adding GA UTM parameters to the redirect, basically as described in this post and the one you linked to. So for example they would redirect to mysite.com?utm_medium=redirect&utm_source=email. Is there a reason you don’t want to use this method? If I better understand what you’re trying to do perhaps I can think of another solution for you.

  2. Thanks Ana,
    I had a couple of issues with using the URL builder. GA seemed to strip URL parameters off the pages in the dashboard. I was also concerned about duplicate content. Is that an issue? Also, I saw in another post that you could use # instead of ?. Is this true?
    I think there was one other question about using URL parameters, but cannot remember it.

    1. In general, GA doesn’t strip URL parameters out of the page reports, but its own UTM parameters are a special case since they show up automatically anyway in the marketing reports. So to see your data you’d go to Traffic Sources > Sources > All Traffic. Alternately, if you wanted to see it tied to landing page, you could go to Content > Site Content > Landing Pages and choose Secondary Dimension = Medium.
      There’s no issue with duplicate content, again GA will just process the UTM parameters and leave everything else the same.
      As for using #, by default you have to use the ? mark, but if you really wanted to use # you could by setting a special option in the main tracking block. Not sure why you’d do this though since if you turned on that option it would just interpret the # exactly the same as the ? and essentially make no difference at all.

  3. Ana, I created the URL, entered a new 301 (in Drupal) and directed it to that URL, then I followed it and looked in GA. Not there. Am I doing something wrong? Has to be something basic.

  4. I will, but yesterday same result. I do want to ask, when you look for the link in GA, it will be /mylink?param1=foo&param2=bar
    Correct? I am only noticing hits on /mylink. Is that how it is supposed to be or will GA show the parameters?

    1. GA will show the parameters except in the following cases:
      1) you’re using GA’s own “utm” parameters. These do get stripped off and interpreted as marketing tags.
      2) you have a profile filter in place that strips them out (check in Admin settings).

      In general GA will report exactly what shows up in the URL bar. After the redirect, are you seeing the full URL + parameters in the URL bar?

  5. Well I put in my own parameters after the utm parameters and the links showed in GA! But I tried one with only my own param and that showed up as well. So what are the utm params for? Are they used for classification/grouping under campaigns?

      1. Hi Ana! I had another question: is there any way to track exit clicks? Not the final destination, but for ex., tracking URL redirects from our site (on Drupal) that go offsite? I hope this is not too obvious.

      2. Thanks Ana, what about a link like mysite.com/mycampaign that is a 301 to another site? There would be no loading of GA as the redirect is immediate. Possible?

      3. Do you mean an outbound link from your site to another site or a link to your site? In the first case you can track it as described, just fire an event when the user clicks. If you mean a link to your site that doesn’t actually go to your site (because it redirects) then you can’t track it because, as you note, the GA code doesn’t load.

  6. Thanks Ana. I mean the latter, e.g. I am using a link in an email like http://www.mysite.com/campaign1 that goes to another site. What I was doing was making a page that had some Javascript on it that forwarded the user after the page loads. That way the GA script loaded before it sent the user to the other site. I know there must be some security and other concerns with this. But thank you once more!

    1. Ana, sorry to post again, but my last was intended to be a question: what are the risks of using JS like I had been doing?

      1. Hey Jonathan, there are issues related to latency and not passing on cookie or tag values from prior pages. Also search engines don’t like it very much (though that’s improved in recent years) so your SEO may suffer. I’m not too familiar with the details as I’ve always just avoided them – I’m sure you can find more comprehensive info out there if you need it.

  7. can anybody help me out?
    I have to track traffic from third party link for my website.
    How would it be the code for the same. I have used 301 redirect but not working

    1. Hey Pravin, sorry, I would need more information. What happens when you click on the link, do you see the “utm” parameters in the URL on the destination page?

  8. I’m a student working on a class project with several competing groups within the class. Can I use this to create a central class hub web page where each group has their own personal redirect link? Ideally, every link would go to the same hub page while allowing the group that sent the reference to get credit for it. Thank you!

Leave a Reply

Your email address will not be published.