I assume that you know you have to send an email with HTML content, that you have already designed it and you have the email ready to send.
To add Google Analytics, as it was a website we need to add a small script to the head meta tags of our email. This is what Google calls tracking code (or similar) and it's so easy to get
from your Google Analytics account. You just need to go to your Google Analytics account, go to the Administrator tab and inside this tab to the div Property that you want to use, go
into Tracking Information -> Tracking Code and there you have to copy the code shown, something similar to:
ga('create', 'UA-12345678-1', 'auto');
Once you copy and paste this code to the head tags on your email we'll have most of the job done.
To register that someone has opened your email, you need to register it as a Google Analytics Event. This is really easy to do. The recomendation from Google is to add an image to your email code
with the actual code for your event. This image will be invisible, only 1x1px and it's recomended to add it to the end of the email, right before you close the html tag.
The source for this image has a link to the event you're going to register in Google Analytics and you can add a lot of different information to as precise as you want and collect as many information
as you want. Some of the most important fields are:
- v: [REQUIRED] always "1".
- t: [REQUIRED] type of the hit, in this case "event".
- tid: [REQUIRED] tracking id of the web property.
- ec: [REQUIRED] event category.
- ea: [v] event action.
- dt: document page title, basically the name of the event that you'll see later.
- cm: medium of the campaing, in this case email.
- ck: campaing keyword, in this case ck=MatchUpPadel%20Email.
But the are many other fields you can use and see at the Google's website measurament protocol
Besides, to help us create this link with the parameters we want, Google has the tool Hit Builder where we can build our own link with each
parameter and we can validate the link at the end.
Feb. 17th 2016, Ourense