Track opens and click activity from Outlook 2013 emails

By Michael Argentini
Managing Partner, Technology and Design

I was recently asked to create a rich marketing email to promote a SharePoint intranet subsite launch. The environment is heavily secured, and the email had to be created and sent to a distribution list of a few hundred email addresses via Microsoft Office Outlook 2013 (as opposed to a web service).

Here are the essential requirements of the request:

  1. Sent from Outlook 2013 within a heavily secured intranet environment.
  2. Must be able to track email "opens".
  3. Must be able to track the click through to the new subsite independent of the organic traffic.
  4. Cannot use any third-party Outlook add-ins.

Luckily for me, even though the environment was heavily secured, they did use Google Analytics (GA) to track anonymous activity. So I ended up with the following strategy:

  1. Create custom HTML with remotely hosted image(s), which is then inserted into an Outlook message.
  2. Track email "opens" by using a Google Analytics tracking pixel (with the GA event model).
  3. Track click-throughs using standard GA UTM dimensions (source, medium campaign, ad content, term).

Create the HTML

One of the first issues you'll run into is Outlook's security model. In my case, the problem was that Outlook does not display images by default. There's no way around this. So I chose to embrace it, and made this email use a single large image for the content. That way, users will be forced to click the Download images button in order to see the content. Otherwise, they may simply read the text and click any text links that are present. The GA tracking pixel won't render, and the email open event won't trigger.

Once I had the image for the email, I constructed the HTML like below.

<html>
<head></head>
<body>
<p>
<a href="http://subsite.northwind.com"><img src="http://subsite.northwind.com/images/content.jpg" border="0" /></a>
</p>
</body>
</html>

So that will render a single image that's clickable. Really basic. So once the image is ready on the production server, I want to add the Google Analytics dimensions so that I can isolate the page views of people who come in through the email. The GA dimensions are named utm_something because a long time ago, Google bought Urchin which later because Google Analytics. The utm_ stands for Urchin Traffic Monitor. The text after the underscore identifies what type of dimension or category you're assigning, like Campaign Name, activity source, or tactic or medium.

For our purposes, we're assigning the following tracking metrics:

  1. Campaign name = SharePoint_Subsite_Launch
  2. Activity Source = Northwind (the company name)
  3. Medium = email (how the traffic was referred)

So here's the resulting HTML:

<html>
<head></head>
<body>
<p>
<a href="http://subsite.northwind.com?utm_campaign=SharePoint_Subsite_Launch&utm_source=Northwind&utm_medium=email"><img src="http://subsite.northwind.com/images/content.jpg" border="0" /></a>
</p>
</body>
</html>

Great. The last piece is adding the tracking pixel. And Google analytics has a built-in feature to provide that.

So what is a tracking pixel? Basically, it's a super tiny, transparent image that sits in your message, effectively invisible to all recipients. When this image is requested from the server, it triggers a counter to increment. Since images are typically loaded when a message is viewed (or previewed), it's a great way to count email opens.

Keep in mind that this will only reliably track total opens, not unique opens. It fires every time the message it previewed or viewed. The only way to get unique opens is to use a unique client id value for each email recipient (see client id below). This means you can't send to a distribution list.

The tracking pixel is a custom event URL with parameters that identify things like your GA account number. There are a large number of available parameters. We'll be using the following:

  1. v = 1 (the protocol version)
  2. tid = UA-00000000-1 (our GA account number)
  3. cid = 1 (client id)
  4. t = event (hit type; kind of activity to track)
  5. ec = email (event category)
  6. ea = open (event action)
  7. el = SharePoint_Subsite_Launch (event label)
  8. cs = Northwind (campaign source)
  9. cm = email (campaign medium)
  10. cn = SharePoint_Subsite_Launch (campaign name)

So below we have our final HTML markup:

<html>
<head></head>
<body>
<p>
<a href="http://subsite.northwind.com?utm_campaign=SharePoint_Subsite_Launch&utm_source=Northwind&utm_medium=email"><img src="http://subsite.northwind.com/images/content.jpg" border="0" /></a>
<img src="http://www.google-analytics.com/collect?v=1&tid=UA-00000000-1&cid=1&t=event&ec=email&ea=open&el=SharePoint_Subsite_Launch&cs=Northwind&cm=email&cn=SharePoint_Subsite_Launch" />
</p>
</body>
</html>

Create the Message in Outlook

So how do you get this HTML into an Outlook message? You can't edit markup in a message any more, which is a shame. But you can insert the markup pretty easily. Start by creating a new message. Then, select the INSERT menu option, and choose Attach file.

When you choose the HTML file, make sure you select Insert as Text at the bottom.

Your HTML email should appear in the message body, ready to be sent. Keep in mind that if your remote images are not accessible from the machine you're using to create the message this won't work. You'll likely get a long pause and then see a blank message window with a tiny icon representing each missing image. It shouldn't affect what the recipient sees, so long as they can access the remote image. But it does. Why? When you insert HTML in this way, Outlook reformats it under the hood. If it detects a missing image, it assigns a width and height of 32 pixels to that image, which will make your final email render incorrectly. So you'll have to assemble the message on a machine that has access to any remote images.

Tracking in Google Analytics

I'm not going to get into the details around how to use Google Analytics here, but I think it's appropriate to show you some of the places where you'll find the data for the email open activities, as well as the link click tracking.

Email Opens

Once you sign in to your GA account, you'll find the email open activity in a couple places. First, in the Real-Time area.

You can also find it within the Behavior area.

You can click through the event category, action, etc. to view the counts based on like values. So if you want to see all email opens, clicking on the open action will do that. If you want to see just the opens tied to the campaign, choose the Event Label option and drill down.

Click-Throughs

Likewise, tracking link click-throughs is just as easy. You can find the data in several places. The easiest place to get a quick glance is in the Acquisitions >Campaigns area.

Best of luck with your own trackable Outlook email campaigns! Contact me if you have any questions or comments.

Article last updated on 4/21/2018