How to serve first party cookies with Mautic - one instance, several domains

Yes it works, but you need to adjust the tracking code to the alias domain name. Which things didn’t work?

True, but this is a different approach with multi installations within one codebase. Different use case - I wanted to have an alias for the very same installation.


Hi Dirk, any chance you may be willing to create a Tutorial over your set up?

1 Like

We could include such a tutorial in the knowledgebase, happy to help!


Yes - why not. Will do… @rcheesley where is the knowledge base?

1 Like but not launched yet. Please start a Google Doc and add to a card on this board!

1 Like


I have set this up. The only difference is I am sharing my Cloudflare level SSL between my Mautic domain and CNAME Domains, a bit simpler then going into Let’s Encrypt and regenerating imo.

One caveat to this set up is the fact that the domain will always appear in your emails as the unsubscribe link even if using the CNAME Domain for Mautic sending and tracking. I think this can be a bit of a deliverability and congruency issue. I ended up spinning up the Mautic instances for each domain instead of going the CNAME Route.

Just my 2 cents on the system.

I appreciate the share.

1 Like

This Multiple Mautic plugin creates multiple Mautic installations using different table prefixes within a single database, but we wouldn’t recommend using it. One of our clients recently had to split their instances apart because the Multiple Mautic plugin was showing the 500 error for any additional instances installed through the plugin.

There’s no guarantee that this third-party plugin is compatible with later releases of Mautic.
Hosting multiple installations within the same database increases the likelihood that something could go wrong (i.e. database crash).

Splitting multiple instances apart was a fairly labor intensive job as we had to dump the DB, drop the tables belonging to other instances, then finally copy the assets, config, media, and themes directories from the non-standard folders that this plugin creates.

Since Mautic is open source and has no license fee for each instance, why not use a container-based solution such as LXC/LXD or Docker to deploy multiple instances of Mautic - one for each domain. That is something we, and our clients have had great success with.


Did you setup the server, too?

I have this situation:


The server that serves, serves also other websites and is setup to redirect to a if a website is not found for the given host.

The server is an Apache one.

I’ve followed those steps to configure the aliases:

  1. Set a CNAME record in my DNS: points to

But when I try to go to, I’m redirected to

In fact, as the server that serves my Mautic instance cannot find any host that corresponds to, simply redirects the browser to, that is the default host configured in Apache.

So, I think I have to add an alias for the host set as

This way the serve will recognize the alias and will serve Mautic both from and

At least I think, I’m going to try…

I’m having troubles trying to configure this setup.

I’ve opened a question on ServerFault: whoever is able to help, please, does so.

Ping @dirk_s

1 Like

Finally I solved it!

After many hours of tests and digging in the server, I discovered it was an issue with the Let’s Encrypt digital certificate: after a new challenge and a new verification of the third level domain, now all works as expected! :muscle:


This question did pop up for me recently and I was just about to write up a post asking if this is an issue the devs have anticipated. I’ve read what docs I can and I think I understand the basic ins & outs.

Can I ask if I’m good to go with how my setup is?

My main site is and my Mautic install is Each have separate SSL certs as on my hosting they are considered separate web applications.

Being that I am using a subdomain of my tracked site I think I should be safe with this setup, yes?

I just set this up, however it doesn’t seem to be working for me…

I set up Mautic on and are both SANs on the same certificate. Both URLs point directly to my Mautic instance, and I changed the tracking code from to

However. when I visit (the Wordpress site where I have placed the tracking code), the console still gives me the same-site error message, and indicates that it’s still pointing to

Any ideas what I am doing wrong?

Yes, you are safe with your setup.

Until the second level domain is the same, there are no issues.

Which is the error? If you don’t post it we cannot know which the problem could be.

Are you sure dns are correctly propagated? Did you created a correct ssl certificate for Can you access Mautic going to

Mautic is installed at

The wordpress site in question is NOTE: the tracking script is only located on the homepage for testing purposes, it’s not in the header at the moment.

The CNAME is set up to point to

I can access my Mautic install at, so the DNS seems to be fine.

I verified that and are both SANs in the certificate.

From the Google Chrome console

A cookie associated with a cross-site resource at was set without the SameSiteattribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=NoneandSecure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at and

If I edit the URL Field under Settings > URL to ", then the issue goes away (but of course it would break it on the other site).

Which version of Mautic are you running?

Current Mautic version is 2.16.3

The only thing I can come up with is somewhere (the actual domain of the mautic install) should be rewritten to (the cname).

Does this KB exist yet? Would love to read it!

Has this feature been recommended for integration in Mautic core? If not, is there a way to request features? We are migrating from SharpSpring and this is standard feature now over there as well as on all the MAPS we have used – Marketo and Hubspot. Considering the wide use of microsites and product specific domains for modern content marketing, this seems like it should be standard part of Mautic too.

Check this post: