Add Google Analytics to your emails!

Set up email tracking with Google Analytics!

  1. Then create a custom metric by going to your admin settings, chosing your property then Custom Metrics.
    add a custom metric in google analytics
  2. Add the following settings
    Google Analytics Custom metric settings
    4. Go to https://ga-dev-tools.appspot.com/hit-builder/ and add the following parameters, change the value of “tid” to your Google Analytics Tracking ID. Then copy the generated parameter string.

    Google Analytics measurement protocol settings

  3. Useful examples can be found here: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#commonhits

    make sure you validate it and test before copying the tracking parameters.

  4. Copy the string from the hit builder and add it to the following image link

    
    <img src=”http://www.google-analytics.com/collect?″ />
    
    

    so it becomes

    
    <img src=”http://www.google-analytics.com/collect?v=1&t=event&tid=UA-12345678-1&cid=unqiueid&cm=email&cm1=promotemplate1&cs=newsletter&el=unqiueid&ec=email&cn=campaignname&ea=open″ />
    
    
  5. Place that image tag just before the closing tag of your body in the email

    <img src="http://www.google-analytics.com/collect?v=1&t=event&tid=UA-12345678-1&cid=unqiueid&cm=email&cm1=promotemplate1&cs=newsletter&el=unqiueid&ec=email&cn=campaignname&ea=open" />
    </body>
    
  6. Replace uniqueid something that gets generated automatically through your email provider.
    For mailchimp its *|UNIQID|* so your tracking should now look something like this if you use MailChimp:

    <img src="http://www.google-analytics.com/collect?v=1&t=event&tid=UA-12345678-1&cid=*|UNIQID|*&cm=email&cm1=promotemplate1&cs=newsletter&el=*|UNIQID|*&ec=email&cn=campaignname&ea=open" />
    

Add your comment