How do I create a new Email Analytics tracking code?


In order to generate your stats, you need to include our tracking code in your email. When your email is viewed by your subscribers, this tracking code will load an image from our servers. This enables us to discern what email client the recipient was using, and how they interacted with your email (printing, forwarding, deleting, and so on).

To get started, click ‘New Tracking Code’ on the Analytics tab within your Litmus account. You’ll be asked to name the code in Step 1:


Once you have named your campaign, you can move on to step 2, where you’ll receive your tracking code. To ensure your Tracking Code collects individual-level data, you’ll need to add a unique piece of subscriber data (merge tag) from your mailing software. You can use email address or any other unique identifier. You can use the drop-down menu to select the default merge tags at some popular ESPs, or enter your own in the box by selecting “Other”:

After you select your merge tag, you’ll need to copy and paste the tracking code into the bottom of your email template. A good place to put it is right before the closing tag in your HTML.

If you don’t want to include individual-level tracking for this report, you can copy and paste the tracking code without adding a merge tag. We’ll still collect as much data as we can, we just won’t be able to link it back to a particular subscriber.

Please note that if you’re using a tool to convert your CSS code to be inline, it’s important to run this tool before you insert your tracking code. If you run it after you’ve inserted it, the tracking code could be altered and prevent you from collecting accurate stats.

Once your code is placed within your template, it is time for Step 3. Send a test email to the address Litmus provides to validate that your code has been placed correctly.

Note: Litmus looks through your email headers to find the email address and associate that email from your Email Analytics campaign. We have found that certain ESPs will “spoof” the To:, CC:, and BCC: fields to some data that isn’t the actual address that you are trying to send to. You may need to change your ESP preferences to send to the email address you enter in or contact your ESP to change this setting for you.

If your code is placed correctly, then it will be activated and your data will begin collecting.


Once you send your campaign you’ll begin to see your stats appear within Litmus. It may take a little while from the time your subscriber opens the email before your graphs and data update inside your report.

If only a few people have opened your email, the data is likely to be quite skewed. Therefore, allow a little time for your recipients to begin opening your message before you try to interpret your Email Analytics stats. Stats typically update 5-15 minutes after the opens have been made.

Start tracking your campaigns

Now that you know how to create a tracking code, try it out for yourself! Start tracking your campaigns with Litmus Analytics.

Start tracking→

Still need help? Contact Us Contact Us