Adding Accountability to Offline Marketing with URL Tracking

by Brian Forrester   |   Feb 08, 2013   |   Clock Icon 4 min read
Close up of team members having a meeting

Vanity URLS (like those used in TV, print, etc) can, and should, be tracked in Google Analytics to add accountability to offline marketing. With that in mind we decided to put together a step-by-step guide to effectively tracking vanity URLs. This is a critical component for online marketers looking to add accountability to marketing efforts for their clients.

There are some good references out there, including this one by Avinash Kaushik (I’m an admitted fanboy) but I thought a step-by-step process for tracking vanity URLs was in order for the SEOs out there who are looking for a way to get it done. So here we go.

Vanity URL Tracking: Introduction

First, just to clarify, we’re talking about tracking a URL, typically used in traditional advertising like print, radio, and TV, that points to your main website URL. For this post we’ll say you’re company is Widget Blaster and your main website is You’ve decided to use a vanity URL, for a TV spot that’s about to drop. The URL is going to redirect to the main site, The issue is, just setting up a 301 redirect or domain forwarder through your hosting company isn’t going to pass on the tracking information you need. You may also want to reuse this URL later for a different marketing effort. This is where vanity URL tracking comes in handy.

Vanity URL Tracking: Step-by-Step

Now that we know which URL we want to track and where the vanity URL will point, we can begin the process of setting up vanity URL tracking.

Step 1. Set up hosting for the vanity URL

By establishing a hosting account for the vanity URL, you will have access to a .htaccess file specifically for the vanity URL through the hosting company. Check with your hosting company about the technical component of this if you are unsure how to access the .htaccess file once hosting has been configured. Some hosting companies may not require you host the vanity URL to have access to the .htaccess file.

Step 2. Create Campaign Parameters

Using Google’s free URL Builder, you can easily create a custom tracking string which will be appended to the end of your tracking URL, passing critical campaign information through to your Google Analytics account. In the screenshot below you can see I entered the destination URL and then provide a Campaign Source, Campaign Medium, and Campaign Name. All three of these are required. Once you've entered the campaign fields, click Generate URL in step 3 and Google's URL Builder generates the tracking URL for you.

Step 3. Redirect Rule in .htaccess

Now that you’ve got your campaign tracking string added to your destination URL, you need to access the .htaccess file for the vanity URL (the reason you set up hosting in Step 1) and add the redirect script. Here’s what that looks like:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT} .*

RewriteRule .*

The URL used in the Rewrite rule is the modified destination URL created with the Google URL Builder in Step 3. Remember, this gets added to the .htaccess file of the vanity URL, not the destination URL.

Step 4. Confirm it’s Working

Now that the hard part is done, it’s time to make sure your Google Analytics account is receiving the campaign information you configured.

First, try typing in the vanity URL. If the tracking script is working properly, you should be redirected and see the campaign parameters appended to the destination URL. If you don’t see this right away, note that it could take several hours to a day for the redirect to take hold. Also be sure to clear your cache. If you’ve done both of these things and still aren’t seeing the campaign parameters, it may be time to back up and punt.

If you are seeing the campaign parameters, Google Analytics should be receiving the data. Again, this doesn’t happen instantly, so you may give it a day before checking.

To check in Google Analytics, follow these steps:

  1. Login to Google Analytics
  2. Click the "Traffic Sources" tab
  3. Click the "Sources" option from the dropdown menu
  4. Click the "Campaigns" option from the "Sources" dropdown menu
  5. This is where your campaign data will live.

Alternately, you can go to "Traffic Sources", "Sources", "All Traffic" and type in the campaign source in the search bar to find any traffic from that source.

If you see results in GA, you are successfully tracking vanity URLs. Sit back and bask in the data! Your clients will love you for improving the tracking capabilities beyond just what happens online.

Portrait of Brian Forrester

Brian Forrester

Brian has spent over 15 years in digital marketing. He is most passionate about building a better agency with an emphasis on culture, community involvement, and the development of our number-one resource, our team.

During Brian’s time as Co-Founder & CEO of Workshop Digital, the agency has won numerous awards including six-time winner of Virginia Best Places to Work, four-time winner Outside Magazine Best Places to Work in the U.S., 4-time winner of Generosity, Inc., an award celebrating top charitable corporate givers in Richmond, VA, three-time winner of the RVA25 Fastest Growing Companies in Richmond, the 2016 Richmond Chamber IMPACT Award, and Brian was also selected for the Style Weekly 40 under 40 list in 2017.

Since his days at James Madison University, Brian has always sought to give back to the community. Brian has served on the Executive Advisory Council for JMU’s College of Business, Marketing, the FETCH a Cure Board of Directors, the IMPACT Awards Selection Committee, and the Town of Irvington Planning Commission. Brian now serves on the Board of Directors at Northern Neck Insurance and is a member of the Virginia Advisory Council for the Chesapeake Bay Foundation.