Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Google Analytics tracking not working in Marketing emails

thomash82948276
Level 3
Level 3

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

0 Replies