In the past few weeks I’ve gotten a lot of questions about how to track email with Google Analytics. While I did cover the broad topic of online ad tracking in a previous series of posts, email tracking has certain nuances that I think should be addressed.
The Concept
Tracking email campaigns in Google Analytics is done using a process called link tagging. This process is the manipulation of the links in your emails. Here’s a sample link that might appear in an email:
http://www.mysite.com/page.php
To track it with Google Analytics it would be modified like this:
http://www.mysite.com/page.php
?utm_campaign=fall-sale&utm_medium=email&utm_source=female-list
And another email link that looks like this:
http://www.mysite.com/page.php?prodid=100
Should be modified like this:
http://www.mysite.com/page.php?prodid=100
&utm_campaign=fall-sale&utm_medium=email&utm_source=female-list
When someone lands on your site after clicking on a tagged link, GA removes the information from the URL and stores it in a cookie. Because the info now resides on your machine (in the cookie) GA can associate all visitor actions (like conversions and transactions) with the email. Pretty slick, huh?
How Link Tagging Works
What is all that info I added to the URL? They’re called link tagging parameters. The name of the parameter is on the left side of the equal sign and the value of the parameter is on the right side.
Each parameter represents a different attribute of your email. Looking at the example above we can identifiy the following parameters and their values:
utm_campaign=fall-sale
utm_medium=email
utm_source=female-list
Each one is identified by the Google Analytics tracking code and helps GA understand that the visitor arrived on your site via an email.
You must use the parameters that Google provides. However, you can specify any value for each parameter. This is where the real power lies. By using your own values for each parameter you can add markting information, that is specific to your business, to GA. We’ll get to where that information appears in a second.
[ NOTE: All you advanced user may be calling my bluff here. You can rename the link tagging parameters that GA uses, but it is an advanced technique that requires a change to the GA tracking code. I’m not going to cover it in this post but you can learn more in the GA help section. ]
Let’s look at each link tagging parameters and some of the logical values for each.
utm_campaign
This parameter identifies the marketing campaign that the email belongs to. It may be that this email is just one part of a bigger online marketing strategy. For example, you may be using paid search, some display advertising and this email to reach new prospects. You can group this email with other marketing activities by using a common value of utm_campaign.
As for suggested values, use something that represents the campaign that your running.
utm_medium
The medium parameter describes how the message got the to visitor. In the case of email I recommend that you always use the same value. I like to use ’email’. It’s short and pretty darn descriptive.
Using a single value consolidates all email generated traffic into a single line item in the reports.
utm_source
This is where things get interesting. Traditionally, in link tagging, the source is the ‘who’ attribute. It describes who you’re working with to push a message out. But how does the concept of ‘who’ map to an email?
When it comes to email I like to think of the ‘who’ as the list of recipients that you’re sending the message to. This may be a segment of your email list (like a specific gender segment, age segment of purchase history segment) or your entire email list. For example, some potential utm_source values might be:
utm_source=gender:female
utm_source=gender:all
utm_source=purchase:last-30-days
utm_source=purchase:last-60-days
utm_source=purchase:free-shipping-offer
The key here is that by identifying the segment in the utm_source parameter you’ll be able to measure the performance of that segment in GA. You are segmenting your email list, right?
utm_content
The final parameter is named utm_content and helps us test emails. The content parameter identifies the actual content of the email. So if you’re producing different versions of the email for an A/B test you can mesaure the performance of each by varying the value of utm_content. For example:
utm_content=free-shipping-offer
utm_content=20-off-offer
utm_content=product-creative
utm_content=value-creative
Some folks like to use utm_content to describe not only the version of the email that the recipient received, but also the actual location of the link in the email.
utm_content=top-nav
utm_content=call-to-action
utm_content=image-link
Sometimes this can be overkill as it leads to a lot of very granular data. Normally we just use this to measure which email variation performed better.
Think about how powerful this can be. Using utm_content and utm_source you can measure the performance of a specific message to a specific segment of your customer base (i.e. email list). This is a great way to measure if you’re sending the right message to the right person!
How to Tag Your Links
So now that we know what paramters we can use to track our email, how do we actually tag the links? It starts by assigning a value to each parameters. You could use the Google Analytics URL builder: a free tool in the GA help center. Just enter a value for each parameter, along with the URL from your email, and the tool will automatically generate a tagged URL that you can place in your email.
But I find the URL builder can be cumbersome when tagging a large number of links. Just think of all the links that you might have in a single email!
Instead I use a small Google Spreadsheet that has a built in formula. Just enter your campaign values in the columns, along with the URLs from your email, and drag a pre-programmed formula to automatically created your tagged URLs. Then place the URLs in your email.
You may have noticed that a tagged URL is pretty ugly. If you’re sending an HTML email to you can hide the long URL using an anchor tag, but if you’re using a text based email the recipient will see the entire crappy URL. Try using a service like Tiny URL to hide the query string parameters.
I should note that some email platforms (the cool ones!) have begun to integrate GA link tagging into their tools. Check with your email provider to see if they offer this service.
The Reporting
As I mentioned before, the values used in your link tags get pulled directly into Google Analytics. Each parameter becomes the foundation for a report. Let’s start with the Traffic Sources > Campaigns report:
This report lists all the values of your utm_campaign parameters. You can measure the performance of your email campaigns by finding the values you use for utm_campaign. But be aware, this report will also contain the titles of your AdWords ad campaigns. They’re automatically imported from AdWords. Also remember that you might use the same value of utm_campaign in activities other than email.
Remember utm_source and utm_medium? We can drill into a campaign to determine how the email medium, for a specific source, performed in the campaign. Select a campaign by clicking on the name. Then use the dimension drop down to view all the sources within the campaign.
The above report shows just one source within this campaign, but that’s all that was used. The important thing to understand is how you can see certain sources, specifically email segments, contributed to the success of a campaign.
But what about evaluating a source across multiple campaigns? Try using the Traffic Sources > All Traffic Sources report:
The first column shows all sources and mediums, so in our case we can see how a segment of the email list performed cross all campaigns. We can quickly filter this report by ’email’, the medium, to identify how well a segment performed. Remember how
What about the utm_content parameter? Where can we find that data? It’s in the Traffic Sources > Ad Versions report.
Here’s where we can evaluate the performance of our different email variations. The Ad Versions report not only contains the values from utm_content, but also the titles from your AdWords campaigns. This is another piece of data that GA automatically pulls in.
And let’s not forget that all of these reports have three tabs full of metrics: site usage, goal conversions and ecommerce (if you choose to use ecommerce tracking). All of these metrics provide insight into the sales or conversion process.
Bounce rate provides insight into the begining of the process. A high bounce rate probably indicates a disconnect between the message in the email and the content on the landing page.
You can quickly switch to the goal conversions tab to measure the other end of the process by looking at the conversion rate for your email. And if you’re using the ecommerce tab you can look at a metric like revenue to qualify the conversion rate.
Don’t Forget the Pre Click Data
While all this data is great, don’t forget that your email provider has a number of metrics that give insight into what happened before the visitor arrived on your site. Such metrics include # emails sent, # emails received, # bounces, # emails opened and click throughs.
I know that metrics like open rate are inherently flawed due to the tracking technology, but you can’t evaluate things like subject line effectiveness using the data in GA. Don’t be afraid to look at metrics like # of bounces when evaluating the performance of email.
Create your Advanced Segment
With GA’s new Advanced Segments we can really drill into the email traffic segment. At the very least, you should create one advanced segment to evaluate email traffic.
To create the advanced segment use the ‘medium’ dimension and enter a value of ’email’. Remember, ’email’ is the value we used for utm_medium in the link tagging. Talk about coming full circle!
Using an advanced segment helps you easily identify what content the email segment found interesting, if they converted, how well the progressed through various processes, etc.
Common Problems
The most common problem we see with link tagging is that people forget to tag their links. Link tagging is usually a process related issue, not a tech related issue. Before your organization sends any email communication make sure the links are tagged.
A simple way to test your links is to send the email to a few coworkers and ask them to click on some links. In a few hours you should see the data in your GA reports.
The second most common problem has to do with redirects. Many times a site may have a redirect that strips off the campaign tracking parameters. The simple test mentioned above should tell you if you have a redirect issue. Remember, when you click on a tagged link you should see your link tagging parameters in the URL of your site.
A Note on Privacy
A few people have mentioned that it is possible to add a visitor’s email address to your GA data using link tagging. While this is possible, keep in mind the GA terms of service specifically forbids the collection of personally identifiable information with Google Analytics.
If you’re still reading, and you’re trying to understand how to track other types of online ads, then you may be interested in these posts:
Hi Justin,
Great post! I was wondering: What are your thoughts on using the Keyword (utm_term) parameter for additional segmentation?
I’ve noticed the Keywords report in GA currently shows only terms from Search & not from all campaigns.
Thanks!
Hi David,
I have seen some people use utm_term to pull more info into GA and I have mixed feelings. While it can lead to extra data it can also lead to confusing data in other reports.
My belief is that you can get enough segmentation without using utm_term, but if you need it then go for it. Just use filters to keep your data clean.
If you do choose to use the urm_term parameter the value will not appear in the Keywords report. The reason is that those reports only contain data from a medium that includes keywords (organic, ppc, cpc, etc). An ’email’ centric utm_term value will only be available via segmentation.
Thanks for the comment,
Justin
A very concise article!
Just for clarification, it should be nice to ad/explain the fact that a campaign can appear up to 6 months after its’ launch, because of the way Google Analytics works?
Hi Justin,
Great article, I only wish you had written it about a year ago :). Not to worry. I’ve been meaning to write one similar for a while now.
I’ve always wondered if there was a way to measure open rates with Analytics, I guess from your post there isn’t.
I know some email providers place a beacon gif file in emails so that you can track open rates, but do you know of anyway you could report on this beacon gif (download rate) in Analytics?
You also mentioned utm parameters being stripped from url’s I noticed that my ISP does this to all emails my old company used to send out, but services like gmail, yahoo! were ok. Does using a service like Tiny URL prevent this?
Cheers and good post.
Gavin
Hey Gavin,
Way back when Analytics first launched, they did track open rates using a beacon. However, so many email clients block beacons and other images, that Google decided to remove the functionality as it was too unreliable.
As for your second question, yes, I’m pretty sure TinyURL will help you get around any parameter stripping issues because a TinyURL does not include any query string parameters.
Thanks for reading and glad you like the post.
Justin
Hi
I tried the same technique above and this was my code that i added “http://www.website.com/index.html&utm_source=Internal_test_mailblast&utm_
medium=Email&utm_campaign=EmailTest”.
But this doesnt work for me,it landed on the 404 page that we have set on the server. Could you please suggest some way to fix this. what could the errors be, and how does this get linked with google analytics when there is no reference of GA code in this,
Great post, I have been doing something similar
one problem I get is seeing a medium of “unknown” in the reports. Can this be caused by using this method?
Also do you think its possible to use this data to add it back into a CRM system as a lead source? Have you had any expierence of integrating GA with CRM.. I have not heard of any that do not try to push their own analytics
I’m looking to track when visitors to my site click on out-bound links, such as a mailto link. I’ve heard that Google’s new Event Tracking will do that automatically but I’m getting mixed messages. Do you have any information about this? I would greatly appreciate any direction you can offer. Thanks Again,
Jill
Hello,
Thank you for the very thorough article. Is Béate posted correct? Can it really take up to 6 months for a campaign to appear in Analytics?
I ask because I just ran my first email campaign using the Link Builder tool (same URL for all links) last week but I don’t see the data anywhere in Analytics.
I can see older email campaigns that other people had run earlier this year, but not mine. The campaign tested fine (using the method you describe) but the data is nowhere to be found in Analytics.
Can i translate your post to my blog (english/portuguese)? It’s very important and nobody have a post about this subject in Brazil. Thanks a lot!
Justin, great post.
Having trouble with the EpikOne spreadsheet, when I click through the URL and start to use it says I can’t edit. Any advice? Thanks, Louis
Nice Article i have done the same.
Best Regards
Great article Justin
Does the site’s GA script need to be included in the email itself?
Thank You!
I started tracking all my emails and have been amazed at just how many people go to my web site from my email. Of course, I put some incentives such as you can see this video or that video, the 3D animation or that presentation. It is important to give them a really good reason to go to your web site, but if you do, track it and see what works and what doesn’t.
Justin,
A crystal clear post. Very nice, very helpful.
This makes me wonder, what insights do you commonly find while looking at these Google Analytics reports on email campaigns?
What changes and optimizations are commonly suggested by evaluating the data in these Google Analytics reports?
Best wishes and thanks.
– Greg
Justin, this is a great article on tracking email with Google Analytics.
You allude to the Google Analytics privacy policy about it not “collecting” personally-identifiable information such as email addresses. But what about passing along a reference id that is unique to a customer on an email list. Would that violate the TOS/privacy policy?
Brad Warthan
Simply a brilliant article, that I often use to explain to my customers how to do propper campaign tracking!
However I think there’s one thing that isn’t formulated correctly:
“When someone lands on your site after clicking on a tagged link, GA removes the information from the URL and stores it in a cookie…”
GA doesn’t actually _remove_ the information from the URL, as this would require GA to do a redirect to the same URL, but without the parameters. True, it doesn’t store the URL with the parameters, but the way it is currently formulated it can be misunderstood.
A question:
If you fx. use tagging to track traffic coming in from a banner campaign to a unique landing page, and Google first encounter this new LP via the banner link, does it store the page in its organic index with or without the parameters?
Can the Google Bot recognize these parameters and remove them before putting the page in its index, or can you suddenly risk getting a lot of organic traffic in from a campaign that you actually track to be something else?
Hey Amit,
There might be two problems here:
1. You need a question mark between index.html and utm_source
2. Your server might be configured to redirect the visitor to a 404 page when unknown query string parameters are added to the URL.
I’m pretty sure it’s one, or both, of those issues. Hope that helps,
Justin
Hey E-Marketing,
Yes, you can use some of this data in your CRM. Check out this post:
Integrating Google Analytics with a CRM
Justin
Jill,
Eventually GA will have automatic outbound link tracking, but it has not been implemented yet. Until Google rolls out this feature you’ll need to manually add code, be it event tracking or pageview, to links that you want to track.
Justin
Erik,
You should see the data very quickly, usually within 3 hours. If you don’t see the data then there may have been a problem with the tracking.
Justin
Alan W,
No, you do not need to add the GA tracking code to the actual email. Just make sure you tag the links in your email and that you have installed the GA tracking code on your site.
Justin
Hey Louis,
You can’t edit the spread sheet, but feel free to export it and use it in Excel, or upload it into your own Google Account.
Justin
Greg,
I think people focus on a lot of different metrics. First, bounce rate. That’s a great indicator of how well the message in your email matches the landing page. Then move on to things that show engagement: PV/V and time on site. Finally, conversions. Did your email actually sell your product or service? I think a lot of people also look at how well different variations of the email performed.
Hope that helps you evaluate your email performance!
Justin
Hi Brad,
A lot of people want to pass a reference ID in the URL, which I think is fine. But the problem is that the ID becomes a pageview level piece of data. All it tells you is that a specific person from email saw the landing page. It doesn’t tell you anything about conversions. Plus, it’s also going to create a HUGE number of unique URLs, and thus pollute your pageview data.
I prefer to pull the data into a CRM to match visitors with email and other marketing initiatives.
Check out this post on integrating GA with a CRM.
Justin
Soren,
Technically, you’re right! It does not remove the data from the URL. It really just ignores it. Thanks for pointing that out!
Justin
Hi Brad,
I am trying to tracking email with google anlytics,i iapplied the same javascript code in web page,i sent the newsletter but i am not getting emails in google anlytics.
How to get the email id’s in google analytics, please send me the reply
This is a great post and very thorough but all the posts I’ve seen don’t say whether you also need to include the ga.js tracking code above the tag of your email? Adding the ?utm code after a url is fine but you tie it to the UA-xxxxxx account by adding the urchin code in your body?
Can anyone verify this? I created a sub domain to track the email separately and it does create a new UA-xxxxx-1 number. What about if you include links to other sites, say to the wiki or google search, whereby running tests on the users click preferences?
I’m nervous of having all the analytics merged in with my site analytics and want to monitor campaigns separately.
Hey Dan,
No, you don’t need to add the ga.js tracking code to your email.
Campaign data will be tracked regardless of the account number. All of the campaign information is stored in cookies, and GA picks up the value in the cookies regardless of the account number.
Hope that helps,
Justin
Thanks Justin. On the subject of tracking, can you use analytics to verify the address is still active, or in other words what emails opened the mail?
I was thinking of using a unique code in the utm content or source, that I could refer back to the original email list and remove the dead ones. On the down side I see this being impractical on large lists as the information would not be available from GA?
This would tie more than just a visit to GA if it worked but an actual user to a location based on opening the email. Any thoughts?
Hey Dan,
You could try something like that. But as you point out, if you have more than 100 email addresses it’s going to be a total pain in the ass to reconcile who opened the email and who did not.
GA is really meant to be a post-click, aggregate data tool.
You may want to check with different email providers to see if anyone offers that level of reporting.
Hope that helps,
Justin
Hi on the subject of email tracking, I am looking to create newsletters for multiple clients (I work in the B2B magazine market) so we feature editorials from a wide range of clients, can I use the techniques outlined above to track activity going to sites which are not owned by us? We are aiming to test how effective our newsletters are for driving traffic to our customers sites.
Can this technique be applied in this situation (where it would not be feasible to have access to add GA tracking code to their pages).
Ive yet to sign up yet, as the first question is what is your website url, we arent looking at this time to monitor our websites as they are in the process of being redeveloped.
Im probably / hopefully thinking about a problem that doesnt exist? Could you confirm whether I can use this technique? Sorry if Ive over – explained this question.
Any help would be much appreciated.
Kate
Kate,
If I read your question correctly, you’re not suing Google Analytics. While you can still tag your links as I described above, you’ll need some type of analytics tool to collect your website data. No analytics, no insight!
Hope that helps,
Justin
How do you track an email hyperlink on your site using onclick?
Mark,
It’s a bit out of date, but try this post on tracking clicks with Google Analytics.
Thanks for the question,
Justin
Hello Everybody,
Can I track the following features using google analytics?
1. Who opens the email?
2. Who they forward to / Did they forward to anyone?
3. How many emails have been sent succesfully?
4. How many emails have been bounced?
Thanks for the great in-depth post.
I was experimenting with the spreadsheet and for some reason it only works if i use a hyphen in the utm_term field. If i add any text in that field the URL disappears.
I’m not great with Excel so i assume I’m doing something wrong. Any thoughts?
THanks again.
-Tom
Gaurav: GA can not track who opened the email or if they forwarded the email. Nor can it track how many emails were sent or bounced. Those are things you should be tracking in your email distribution tool.
Tom:Thanks for the heads up! We’ll try to fix that ASAP.
Thanks for the comments and thanks for reading the blog!
Justin
now that GA goals can be imported into conversion tracking…
is it possible to create a goal for a click on an email link?
Dan,
If I may read into your question a bit, you’re asking if it’s possible to create a goal is someone clicks on a link in an email? If so, no. We can not create goals for clicks withing an email. The reason is that the click happens in the email, and we can’t add GA into the email. We can only track the visitor once they arrive on the site.
Hope I’m reading your question right.
Justin
WOW.
That’s the best post I have ever seen so far explaining link tagging and how to do that.
Thank you very much!
I am new to Analytics but I was able to understand a LOT from you!
Hi,
Just wanted to say thank you for the clear and concise info and instructions.
Cheers
G
Visitors to our website who access it from General Santos City, are not shown in Google Analytics as having accessed the site from that city. I have yet to have one single hit registered as such.
I believe hits from GenSan are being attributed to the city of Davao, a city found at a great distance from GenSan.
Why does General Santos City,a city of approximately a half of a million people, not register on my Google Analytics?
I would ask Google directly. But, you need ground penetrating radar to find a Google email portal where they will accept a question they would be willing answer.
Just dl’ed this sheet for my use. DEFINITELY saves time over using the Google tool. Thanks, guys!
Also, an *excellent* primer on how to use GA for email recipient tracking, and one I’ve referred to often enough myself. An all-around good effort.
Hey Trevor,
Thanks, glad you like the link tagging sheet.
g. mertz,
Geo location data is done based on the IP address of the visitor. While this is fairly reliable, it’s not 100% accurate and there can be errors. I think you’re just seeing some of the normal inconsistencies with geo based data.
Thanks for the comments,
Justin
from my experience, shortened urls (bit.ly et al) are less effective than long urls. Users don’t like them.
Justin,
I realize you wrote this several years ago, but I’m hoping you can still help. I’ve been researching this for weeks now and trying to find a way to track a click to a PDF from an e-mail. The PDF is not on the website itself, so is this not possible?
I’ve checked EventTracker, tried campaigns, but nothing seems to track the click. The latest I tried was adding this hyperlink to the e-mail:
http://www. aac.joinvacation.com/training/NextStepsEZcruise.pdf” onClick=”javascript: pageTracker._trackPageview(‘/downloads/EZCNextSteps’);
Because the PDF isn’t on the site and you never actually hit the site, is there a way to add the tracker code to the link itself?
Please help – I’m desperate.
@Mmarq: Tracking a PDF from an email is a tough challenge. The problem is that there is no place to fire the JavaScript. You could try to put the JS in the HTML of the email but that is not very reliable. I would try the following:
1. Direct the visitor to some type of re-direct page.
2. On this page put a slight delay and execute the GA tracking code along with your event tracking code.
3. Then direct the visitor to the PDF.
Hope that helps,
Justin
But how do you actually embed the google analytics code into the email. I am using outlook 2007 and I can find no way to actually embed the code@?
@Ben: You don’t add the Google Analytics tracking code to your email. You add the utm parameters to the links that are in your email. Then, when someone clicks on a link in the email the Google Analytics code that is embedded on your site tracks their activity, including where they came from, which is the email.
Hope that clarifies things.
Hey Justin,
Great article. Just wondering about using the URL tool for links such as: “mailto:info@mywebsite.com”. Same concept?
Hope you are enjoying life at Google!
@Les – No, to track mailto: links then you need to use something like a virtual pageview or, my suggestion, would be to use an event. The reason is that mailto: links appear in an HTML page. You need to capture the visitor’s click on that link.
Hope that helps!
Hey Justin: Yes this helps very much. I have since figured out that I need to use Event Tracking – which I have implemented. For some reason though, my Events are not showing up in GA. I took a look with FireBug and GA seems to be getting sent the JavaScript. Would you mind if I posted a snippet sample for you to look at as my head is spinning from trying to resolve this.
I know you are busy with the new Google gig, so I have no expectations and will fully understand if you do not have time to reply.
L :-)
@Les – You need to look at every request for __utm.gif. Specifically look for __utm.gif hits that say event. Also, you may want to add a timer to your JavaScript that forces the browser to wait 200 ms while the __utm.gif hit is sent.
Great article thanks,
Will this stuff continue to work or has some of it (methods or GA services) been deprecated? I ask because when I was reading up on these topics I noticed on the google url builder tool page you referenced http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55578 that there is a deprecation notice.
Thanks again.
@Cal: Yes, you can still track email campaigns in the same manner. The only thing that has changed is the GA help center. The link tagging tool is still more or less the same.
Hi,
Can we still use GA for tracking email opens? For example the article at http://www.kontain.com/karlstanton/entries/47993/tracking-your-email-campaigns/ seems hacky and a little dated but appears to have worked. It uses an img link in the email and a redirect to capture the open email event and fire the google utm.gif call and then return an image to the client. Is that still allowed and viable?
Thanks again.
@Cal: In theory yes, you can manually create a gif hit back to Google’s collection servers. But as you mentioned this is pretty hackish. I would suggest using the open metric from your email provider. It’s probably calculated the same way and will save you work.
Thanks Justin,
I was trying to get that trick (above) to work but the url i produce doesn’t seem to do the trick when called from the command line, but does work when pasted into a browser – in other words the url call from the php code does fetch the utm.gif but does not register as a hit in analytics But when put into the browser url bar it does. is there some browser info that the call needs?
I appreciate the information. I’m a content expert but to hang on to my print newsletter of the past 24 years, I have to come up with an online version–wham! Just like that. I can design the newsletter using Dreamweaver, but putting all the tracking and other apps to work and building a mailing list–those tasks elude me.
Thanks for giving me a good start.