Google Analytics tracking not working in Marketing emails

thomash82948276

06-11-2018

We're applying Google Analytics tracking to our emails using the External Accounts, Web Analytics tool in Campaign.  The code we're using is as follows:

<%@ include option='NmsTracking_ClickFormula' %>

<%  // Parameters expected by the Web Analytics partner

var pattern = new RegExp("(https://)", 'i');

if( $(urlstring).match(pattern) && delivery.FCP == false ){%>

  &utm_source=auto&utm_medium=Email&utm_campaign=<%= message.delivery.internalName %>

<% } %>

This works for our Message Center emails.  In so far as the specified UTM parameters are being appended to our URLs.  However, this isn't working on our other, non real time emails.

Can anyone see anything obvious in the syntax above that could be causing this?

Many thanks

Tom

Accepted Solutions (0)

Answers (0)