This is a hot topic, as cookie based tracking can be tricky in a multi-domain environment. I started to work on a solution couple of months ago, and ended up creating a plugin, that helps with the multi-domain tracking.

In order to get you covered in your multi-domain tracking endeavors, I would like to share 2 videos and some code with you. Have fun.

If you are trying to track multiple domains with Mautic, you’ll face the following issues:

  • You need to serve first party cookie to your Mautic domain on every tracked domain.

This means: if you have Mautic on domain1.com, you can’t freely track domain2.com anymore. You need to set up a tracking domain using a CNAME, like mautic.domain2.com, that resolves to domain1.com.

  • In order to have great inboxing rate you’ll need to keep the domains in your email relevant to the sender, and the content you are sending.

This means: if your Mautic is on domain1.com, all your unsubscribe links and other links in your emails will have domain1.com. This domain can influence your inboxing rate even if you send from domain2.com. However you can add tracking domain in this case as well, and with the help of the Multi-Domain plugin you can now mask all your links and delete tracks from the Mautic domain.

You can learn more about why Multi Tracking matters in the following Mauticon presentation:

Watch the Marketing Automation Show for a walkthrough, and start using Multi-Domain tracking

You can download the plugin here:

https://github.com/friendlyis/mauticmultidomain

Do you have questions? Add it to the comments!

31 Comment

  • Marcel

    says:

    Just wanted to check if I understood everything since my set up is somewhat different.
    My Mautic instance is at
    connect.website.nl

    And I have another website at another server
    otherwebsite.com

    So in cPanel at otherwebsite.com, I create a CNAME
    connect.otherwebsite.com

    pointing to
    connect.website.nl

    And in cPanel at website.nl, I create an add-on domain
    otherwebsite.com

    with subdomain
    connect

    pointing to the root of my Mautic instance.

    Next in my otherwebsite.com site, I change the tracking link to
    connect.otherwebsite.com

    instead of
    connect.website.nl

    And finally, in Mautic in the Multidomain plugin settings, I want
    marcel@otherwebsite.com

    to use the domain
    https://connect.otherwebsite.com

    Reply
    • Nezam

      says:

      There is a simpler way if you are using CyberPanel. Just add the sumdomain.website as an Alias domain to Mautic domain and add a CNAME for subdomain.website pointing to Mautic domain. Thats it!

      Reply
  • Max

    says:

    Just installed.

    Beyond the dns and server configurations, are there any configurations with the plugin itself.

    I don’t see the Multidomain plugin settings?

    Reply
    • jos0405

      says:

      Hi, no other settings are needed.
      All tracking links will be overwritten based on the Multi Domain settings (left menu.) Add the email and the domain that should be used for masking.
      As it is in Beta, newsletter image content is not overwritten, you have to do it in your html.

      Reply
    • jos0405

      says:

      No because bounce handling is a return process, you will still listen on the same channel with the same domain as before.

      Reply
  • Luca

    says:

    Thanks for the plugin and the explanation.

    You said that the current version of the plugin only works with Mautic 3.x
    Any idea when there will be a version of the plugin that works with Mautic 4?

    Reply
  • Neo

    says:

    has anyone tried accessing your website using latest safari browser , where 3rdparty cookies do not work, and succeeded with this configuration ?
    will mautic forms work too ?

    Reply
    • jos0405

      says:

      Hi,
      The point is, that you serve first party cookies, so you are not affected by evil Safari rules.
      Forms? Hmm. I’m not sure, good point ๐Ÿ˜€

      Reply
  • R el

    says:

    Anyway to change the message-id in the header? The plugin is working good, however the message-id: still shows the original host domain, not the tracking domain.

    Reply
  • Steve Robinson

    says:

    Any ideas on how to make dynamic web content work across domains? It seems that the DWC http request goes to the base URL in the configuration regardless of what domain is used to call mtc.js.

    Reply
    • jos0405

      says:

      Hello Steve!
      Good question. It depends on website settings I beleive, but you can always CNAME the other domain, so you would stay in the first party realm.

      Reply
  • Pete Petrov

    says:

    Hi Joe,

    I can not install it on Mautic 4.4.1. I have uploaded it to plugins folder, but it doesn’t show in my plugins. Any idea what could be the issue?

    Thanks,
    Pete

    Reply
  • Jan

    says:

    Hello Joe, After uploading the plugin to my plugin folder and deleting the cache and pushing the ‘Insatall/upgrade plugins’ button, the plugin is not showing up.

    This is the content of my plugins folder with the Owner / Group and permissions:
    drwxr-xr-x 14 www-data www-data 4096 Feb 28 2022 GrapesJsBuilderBundle
    drwxr-xr-x 17 www-data www-data 4096 Feb 28 2022 MauticCitrixBundle
    drwxr-xr-x 12 www-data www-data 4096 Feb 28 2022 MauticClearbitBundle
    drwxr-xr-x 9 www-data www-data 4096 Feb 28 2022 MauticCloudStorageBundle
    drwxr-xr-x 15 www-data www-data 4096 Feb 28 2022 MauticCrmBundle
    drwxr-xr-x 9 www-data www-data 4096 Feb 28 2022 MauticEmailMarketingBundle
    drwxr-xr-x 16 www-data www-data 4096 Feb 28 2022 MauticFocusBundle
    drwxr-xr-x 13 www-data www-data 4096 Feb 28 2022 MauticFullContactBundle
    drwxr-xr-x 6 www-data www-data 4096 Feb 28 2022 MauticGmailBundle
    drwxr-xr-x 13 www-data www-data 4096 Aug 31 11:11 MauticMultiDomainBundle
    drwxr-xr-x 7 www-data www-data 4096 Feb 28 2022 MauticOutlookBundle
    drwxr-xr-x 17 www-data www-data 4096 Feb 28 2022 MauticSocialBundle
    drwxr-xr-x 13 www-data www-data 4096 Feb 28 2022 MauticTagManagerBundle
    drwxr-xr-x 4 www-data www-data 4096 Feb 28 2022 MauticZapierBundle

    I have installed the plugin on a fresh Mautic 4.2.0 instance

    Any Idea what could have gone wrong?

    Reply
  • George

    says:

    Hey Joey, could you help.

    Before the installing the plugin… I send a test message to one contact… All good.

    After installing the plugin ( Tried With and Without adding a domain+email pair in the plugin)… When i send a test email i get:
    Uh oh! I think I broke it. If I do it again, please report me to the system administrator!
    500 Internal Server Error

    PHP Version 7.4.32
    Mautic v4.4.3

    Thank you!

    Reply
  • charlse

    says:

    Hey Joey, could you help.
    Hi, I installed and used this plugin before and it worked fine.
    Itโ€™s just that all the links in my email have been modified to the new domain name, so I deleted the configuration of this plugin, but the links in the email did not restore to the system domain name I configured; then I deleted the plugin and cleared the cache directory. But the link in the email still hasn’t returned to the system domain name I configured.

    I would like to ask how can I completely restore the domain name configured in my system.
    may thanks!

    Reply
    • jos0405

      says:

      Hi, I also answered you on Youtube, where you left the same comment.
      If you remove a plugin, clear the cache and maybe also run bin/console mautic:plugins:reload, then it should be gone from your system.

      Reply
  • Dinos

    says:

    Hello,
    Everything you describe here works perfectly. There is still a problem though when not sending email.

    When you inject a form using the provided script then the generated form uses the domain set in configuration –> system settings -> site url

    even if you use the cname domain, all caprtcha js e.t.c will be taken from main mautic url and not the cname one

    The only workaround i have found so far is to use the manual copy method to inject the form to a website replacing the mautic domain with the configured cname as described in the article

    Have you got a better workaround for this?
    Keep up the good work
    Thank you in advance
    Dinos

    Reply
    • jos0405

      says:

      Hello Dinos,
      Thank you for this comment. Yes, need to take a look.
      We already fixed issues with tracking (same situation)
      Joey

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *