Mautic Campaign URLs arriving with random subdomain instead of correct subdomain

My Mautic version is: 2.15.3
My PHP version is: 7.2

My problem is: When emails are sent from a campaign or directly with URLs in them, these arrive with some random number appended as the subdomain instead of the proper Mautic install subdomain i.e. instead of linking to they point to

We are using SendGrid for delivery. We have a number of clients with the same setup, same hosting, same everything and this is not an issue. So I’m a bit stumped.

NO errors are showing in the log

Steps I have tried to fix the problem:

  1. Opened the emails in ‘preview’ and they appear to be fine.
  2. Sent myself an email directly via CHANNELS > EMAIL > … > TEST EMAIL and it sends incorrect URLs.
  3. Enrolled myself in a campaign to send the email and the email arrives with incorrect URLs.
  4. Checked all the settings and configuration to see whether something is missing.
  5. Gone to CONTACTS > my own contact record > SEND EMAIL > IMPORT FROM EXISTING EMAIL TEMPLATE > Send… the email arrives as though it’s from me and via sendgrid. The URLs link as Sendgrid tracking URLs e.g.

Anybody had this issue before or have some idea where I should start looking to solve it?

Many thanks!

Fortunately, this is an easy one to solve! :slight_smile:
Because Mautic is already tracking clicks on the links in the email, it’s redundant to use SendGrid to track click statistics in their dashboard as well.

If you disable Click Tracking inside your SendGrid account, it should stop rewriting those links with the vanity URL that you verified when you set up your email gateway.

1 Like

Oh, thank you for this insight @autoize that’s fixed it up! I’m very grateful for your help.

1 Like


If event tracking is enabled in Sendgrid will this override the mautic tracking ?

I am asking as I have a number of clients, and up till now I have had them on separate Sendgrid accounts because of the click tracking, but it would be great to have them on ones Sendgrid account and that I can be confident that the clicks are being tracked as well. (and should I remove link branding from Sendgrid)



That’s a good question.

Each sending domain in SendGrid can have its own subdomain for branded links.
No, it doesn’t override the Mautic tracking. What happens when you have the SendGrid “click tracking” turned on is SendGrid rewrites the links in the emails sent out from with (SendGrid tracking) redirects to (Mautic tracking) redirects to the destination URL.

It’s up to you whether you want to use link branding or not when you have multiple sending domains under the same SendGrid account. Either way is fine.

1 Like

Thanks @autoize. I actually ran a test today and saw that tracking works just fine.

I was even looking at getting my dev to build me a Webhook layer to take web hooks and redirect them, however I noticed that when Sendgrid send back the Webhook, it does not send back the domain, only the different responses.

This morning woke up and remembered bounce, spam & unsubscribe. I have not seen that Mautic will take care of bounces without getting the call Webhook back from Sendgrid or another ESP.
Am I mistaken here ? If not any idea how you would deal with this using multiple Mautic’s with one Sendgrid account ?