How To Track Your Emails Using Google Analytics

Google Analytics ( GA ) is a great free resource to stay on top of your website’s performance, but did you know that GA is also useful for monitoring your outbound emails? In this post we show you how to use GA to gain statistical insight into your outgoing emails. If you are a SendGrid user, you will also learn how to use our REST API along with our free GA filter to simplify the process.

Tracking Conversions

Define each URL that leads up to the page where the conversion happens, this is usually the “Thank You” page after a successful transaction.

Assign a dollar value to the conversion.

Once you have completed those steps, you can use the “Goals” link on the left navigation area within GA to view conversion data such as the number of overall conversions, the value of those conversions and conversion rate. To dig deeper, check out this in-depth treatment from SixRevisions.com.

Using the SendGrid REST API and Google Analytics Filter to Simplify the Process

To try out this method, you will need to sign up for a free account at SendGrid.com. Shortly after you sign up you will receive a verification email that will inform you when your account is active.

Here is the directory structure used for this example along with links to the appropriate files:
/Swift-4.0.6 – download
/smtpapiheader.php – download
/index.php – download

I suggest you read through the index.php code, updating the settings and credentials as you go through. Then, you can run the code on your local environment or on your web server by simply entering the root URL that contains the index.php file. Be advised that this code will not work until your SendGrid account has been activated.

Examining the Data in Google Analytics

Once the recipients of your emails begin to click on your URLs, those clicks will be recorded in your Google Analytics statistics. Here are the steps to locate that data:

Login to your Google Analytics account.

Click on “View report” next to the appropriate account.

Click “Traffic Sources” on the left navigation area.

In the same area, click “Campaigns”.

Note that Google Analytics does not display data in real time, so it will take a few hours before you start to see the data.

Within this view you can obtain data such as visits, pages/visit, average time spent on your site, percentage of new visits, etc.

Dig Deeper with SendGrid’s Analytics

If you are a SendGrid user, you have access to additional data that can help you become even more effective with your email campaigns. After logging into your SendGrid account, click on the “Statistics” tab to view your outgoing email statistics. The data on this page shows you the number of requests, delivered emails, clicks, opens, bounces, blocks and spam reports.

You can also obtain a downloadable list of all the bounced, blocked, unsubscribed, spam reported and invalid emails by clicking the “Email List” tab and the appropriate sub-tab.

We want to hear your experiences, we love great feedback and collaboration. How are you currently tracking data on your outgoing email? Have you used SendGrid’s Google Analytics filter? What was your experience? Ideally, what type of data would you like to be able to track?

Keep up to date on the latest SendGrid news by subscribing to our blog rss feed and/or follow us on Twitter.

Related Posts

Author: Elmer Thomas

Elmer Thomas is SendGrid's Hacker in Residence. His mission is to help SendGrid live up to its slogan: "Email Delivery. Simplified" by improving the lives of developers, both internally and externally. Via all sorts of hackery, of course. Follow his exploits on Twitter and GitHub.