Mautic Community Forums

ID instead of trackable link

Google mail does not like redirection links in emails.



It tells them it’s a marketing message and goes to spam or one of the other tabs (Marketing / Promotion). However, we can’t track link opens. Our idea was to use the id (i.e.

Code:
http://myside.com?id=1234
) which the lead id from Mautic, then the website would send to mautic the ID
Code:
mt('send', 'pageview', {id: id});

However, mautic does not recognize the ID and properly set the cookie (we don't see they opened the site in mautic).

Any idea why?

Google mail does not like redirection links in emails.

It tells them it’s a marketing message and goes to spam or one of the other tabs (Marketing / Promotion). However, we can’t track link opens. Our idea was to use the id (i.e. http://myside.com?id=1234) which the lead id from Mautic, then the website would send to mautic the ID mt('send', 'pageview', {id: id});

However, mautic does not recognize the ID and properly set the cookie (we don’t see they opened the site in mautic).

Any idea why?

@escopecz , if this is something that needs development we can invest it in. Getting past spam filters and running good campaigns requires being ahead of best practices (other email filters behave the same way, or will catch up)

[Edit: I checked the browser logs and mt does send the id, also but we can see field mtc_id which is an anonymous lead and we can’t override it]

We seem to have figured it out. We need to alter the tracker insertion code to change cookie + localStrage using onload function of the scrip tag.

Once you get your id from the URL:

// removing noise from email clients
id = id.replace('^.*D','').replace(/].*$/,'');
// mautic + transmission of id in pageview
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
      w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
      m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;a.onload = function() {
        if (id) {
          MauticJS.setCookie('mtc_id', id);
          if (window.localStorage) window.localStorage.mtc_id = id;
        }
        mt('send', 'pageview');
      }; m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://mautic.mydomain.com/mtc.js','mt');
1 Like