Sunday, November 14, 2010

New Feature: Google Analytics integration now works with transactional email

Google Analytics integration is now available with transactional email sent through the SMTP relay or through the API.

If you're already sending mass emails through JangoMail and using Google Analytics, then you need not change anything for your transactional email to also start working with Google Analytics. The only difference between the way in which mass emails are tracked versus transactional emails, is that the "Subject" becomes the "Transactional Group Name" and the "CampaignID" becomes the "Transactional Group ID".

For example, if you're using the default Google Analytics settings in your account, as shown below:



Mass emails with click-tracked links will take the recipient to a URL that looks like this:

http://www.browniekitchen.com/?utm_source=JangoMail&utm_medium=Email&utm_campaign=Welcome+to+Brownie+Kitchen+(789829313)&utm_content=ajay.goel%gmail.com

Transactional email with click-tracked links will take the recipient to a URL that looks like this:

http://www.browniekitchen.com/?utm_source=JangoMail&utm_medium=Email&utm_campaign=Welcome+Group+(22514)&utm_content=ajay.goel%gmail.com

Notice that the difference is that with transactional email, it's not the Subject of the email that gets recorded in Google Analytics, but the Transactional Group name to which it belongs. This determines what the campaign is named inside your Google Analytics account. For mass emails, it makes intuitive sense that the campaign would be named by the mass email's Subject line. For transactional email, it wouldn't make sense to use each individual email's Subject line, because if you send 1,000 transactional emails, all with different Subject lines, you'll end up with 1,000 different campaigns in your Google Analytics account, and making sense of the data would be impossible. That's why transactional emails will be categorized by their Transactional Group Name and not their Subject.

You may use any combination of these values in the four Google Analytics variable fields:

%%EmailAddress%% = the email address of recipient
%%Subject%% = the subject of the mass email campaign
%%CustomID%% = a custom identifier chosen by the user for mass email campaigns
%%CampaignID%% = the JangoMail identifier for a mass email campaign
%%TransactionalGroupName%% = the Transactional Group Name of a transactional email
%%TransactionalGroupID%% = the Transactional Group ID of a transactional email


%%Subject%% and %%CampaignID%% are used for mass emails and %%TransactionalGroupName%% and %%TransactionalGroupID%% are used for transactional email. However, if you are using %%Subject%% and %%CampaignID%%, and you send transactional email, then %%Subject%% will be treated as %%TransactionalGroupName%% and %%CampaignID%% will be treated as %%TransactionalGroupID%%. That means that if you're using your account to send both mass email and transactional email, you can leave the defaults in place for utm_campaign:

utm_campaign: %%Subject%% (%%CampaignID%%)

This setting will allow Google Analytics integration to work with both your mass email and transactional email messages.

More Reading:

For more information on our Google Analytics integration including screenshots of what your campaigns will look like inside Google Analytics, please download the PDF guide to JangoMail's integration with Google Analytics.