Mautic Community Forums

URLs in segment email are not using the site_url

Hi, nice to be part of this community. It would be great, if someone with similar setup could help me out with the following:

Your software
My Mautic version is: 3.2.1 (we observed that already with 2.16.x)
My PHP version is: PHP 7.3.25
My Database type and version is: MariaDB

Your problem
Our Mautic installation runs on a machine with hostname internal-hostname.domain.com . The machine is accessible from the internet (e…g by tracking urls, preference center links etc.) through a different url/hostname (https://external-sitename.domain.com), which is configured as the Site Url in mautic.

When we send emails, the site_url must be placed into outgoing emails, otherwise the email recipients are not able to access any urls in the emails.

When building a segment email, emails can be send either efecctively using the “Send” button, or as a test (Send Test).

When we send emails as a test, the URLs are substituted correctly with the site_url (external hostname).

When we do a “real” send, the URLs are substituted with the internal hostname, which makes URLs broken.

Has anyone experienced a similar behaviour and knows how to solve that?

These errors are showing in the log:

There are no error in the log.

Steps I have tried to fix the problem:

Thanks a lot in advance and best regards

Jan.

Hello Jan!
This is what happened when Mautic sends out a real send, all emails will be replaced with the tracking domain (mautic url) for tracking purposes.
This is how Mautic knows someone clicked (+a tracking img will also track your opens containing the same url)

However during simple testing this doesnt happen.

You can mitigate this issue by using the same trick you used for your website tracking.

Joey

hi Joey,

thank you for taking time for this issue - and forst of all: a happy new year to you.

( Sorry for taking so long to answer, I was on vacation).

I was just checking and what happens is, that also the tracking of the website urls in not really working, i.e. the urls are showing up

  • with the internal hostname, when I send in “real” mode
  • in the original style/destination when in test mode

Could you give me a hint what you mean by “mitigate the issue by using the same trick”?

Thanks and regards

Jan.

Hi, let me explain:

Your problem:
You installed your Mautic on an internal domain, that is not accessable from the internet.
-> This resulted in using a website tracking domain not accessible from the internet.
-> This also resulted in using a domain in each email for the tracking pixel + links, that is not accessable from the internet.

You are writing:

When we send emails as a test, the URLs are substituted correctly with the site_url (external hostname).

You substituted it manually. That is overwritten by Mautic when the real email is sent out. (It is called click tracking.) Also your tracking pixel will use the same (secret) domain.

Solutions
There are 3 solutions in my opinion, and you not gonna like them.

  1. Re-install your Mautic to the domain, that is available over the internet. You can’t track if you are not available. Use your internal domain as an alias, this way Mautic is also available from inside.

  2. Change your domain settings in Mautic (and replace all domains with mysql) in your database. Use your internal domain as an alias, this way Mautic is also available from inside.

  3. Create a plugin, that allows you tu use a tracking domain, that is separate from your Mautic install domain.

Important
In order to be the proper Tracking Overlord and ensure proper site tracking you want to store first party cookies on your visitors computer. If you are not using a subdomain of the domain your are tracking (for multi-domain tracking see Autoize’s solution: How to serve first party cookies with Mautic - one instance, several domains)

Glossary
Tracking domain = the domain where you installed your Mautic.
Install domain = in case of Mautic it’s the same as tracking domain, but in general the domain you install Mautic on.
Mautic First party cookie = Mautic is using a subdomain of the domain you are tracking.
More:

Thanks for your help and suggesting a solution for segment emails!

After evaluating again, we found that is is possible to send emails to a segment by using a campaign; when issuing emails via a campaign (ie. creating a campaign with the desired source segment, and adding a ‘Send Email’ action step), the substitution works perfectly, and open-, and clicktracking is working fine!

Thanks and regards!

Jan.