Mautic Community Forums

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

Hi,
if you use different domains (e.g. for marketing purposes) and one Mautic instance there is one raising problem: You serve 3rd party cookies, which will automatically be blocked by Firefox already and Chrome soon.

Here is an approach I successfully used with Matomo. I would like to find out, if this may also work for Mautic.

Mautic should now work for both Domains. Do you see any issues with this concept? Its working with Matomo. In case it works, I will write an Howto for you.

(Separating leads is not considered here - its just for the purpose of a company using several domains for the same audience.)

5 Likes

Glad that you raised this issue in the forum.

In the coming weeks and months, this will become a very important issue for most Mautic users. Have already been noticing embedded forms from marketing automation applications (not just Mautic) showing up as blank when embedded from a different second level domain.

Using a CNAME and an SSL certificate signed for both ma.Domain-A.com and ma.Domain-B.com is an interesting approach. A cleaner solution, if at all possible, is setting up multiple Mautic instances (one for each SLD) but there are situations where both domains should share a single marketing database. For example, when a company has multiple subsidiaries that share some common prospects and customers.

There could be some issues when Mautic redirects the user from a form, and rewrites the URL with the SLD where it is a truly installed (i.e. ma.DOMAIN-A.com) - but for tracking only, this could very likely work fine.

OK - You are right. Embedded forms should also be adopted to the alias domain. Then it should be no issue, as the URL will not be rewritten. Its an alias. I stays ma.DOMAIN-B.com… For Mautic Landingpages maybe there should be added a canonical ta, as otherwise the same content is available under different URLs (duplicate content). However, its only relevant if a landingpage is made for the purpose of SEO as well, not just a non indexed page as target for marketing campaigns.

Update: first test looks promising.

Mautic login and backend works no matter if I call it through http://ma.domain-a.com/ or http://ma.domain-b.com/. Also landingpages can be reached through both ways. This will probably be the same for the scripts to embed and the forms (will test next).

I could image, that automatically replacing links in email will hold the original URL (as Mautic system doesn’t know about this dual URL setup). Not sure, if this may influence spam score, if links differentiate from sender URL?

Also system pages will always come from the original Mautic URL and theme. So they need to be designed in a way people understand its still the same company.

Hmmm, nice solution.

I have similar problem at One installation, few domain and websites

Hi Dirk, did you make any additional progress here?
When I first tried this, the Mautic backend was not a problem, but tracking & things didn’t work. So… did those work for you?

I found something like this
Installation under subdomains will help?
See this " First multi tenant solution for Mautic"

Mautic Multiple Bundle allow link Mautic installations in one directory. This allow easy manage multiple Mautic for your clients along with maintenance, updates, fixes and much more.

Multiple Bundle create virtual links for any domain or subdomain. You can use from one directory any Mautic, for example:

1 Like

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.

2 Likes

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!

1 Like

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

1 Like

kb.mautic.org but not launched yet. Please start a Google Doc and add to a card on this board!

1 Like

Hi,

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 MainMauticInstall.com 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.

1 Like

Did you setup the server, too?

I have this situation:

  1. mautic.domain1.com
  2. mautic.domain2.com

The server that serves mautic.domain1.com, serves also other websites and is setup to redirect to a maindomain.com 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: mautic.domain2.com points to mautic.domain1.com

But when I try to go to mautic.domain2.com, I’m redirected to maindomain.com.

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

So, I think I have to add an alias for the host mautic.domain1.com set as mautic.domain2.com.

This way the serve will recognize the alias and will serve Mautic both from mautic.domain1.com and mautic.domain2.com.

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:

2 Likes

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 https://torontoheadshot.com and my Mautic install is https://marketing.torontoheadshot.com. 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 ma.domai-a.com. Domain-a.com and ma.domain-b.com are both SANs on the same certificate. Both URLs point directly to my Mautic instance, and I changed the tracking code from ma.domain-a.com to ma.domain-b.com.

However. when I visit domain-b.com (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 ma.domain-a.com

Any ideas what I am doing wrong?