CORS Settings¶
When setting up Cross-Origin Resource Sharing (CORS), you're essentially creating a secure bridge between the customer’s website and Mautic. This process ensures that only authorized domains can communicate with their instance, protecting it from unauthorized access while making sure that tracking data is not blocked.
Requirements¶
- Access to Mautic's administration panel
- List of domains that need to communicate with Mautic
Info
No list? Ask to the customer.
Step-by-step guide¶
- Navigate to
Configuration>System Settingsin your Mautic - Locate the CORS Settings section
- Enable domain restrictions by setting "Restrict Domains" to Yes
- Add your authorized domains in the Valid Domains field:
- Enter one domain per line, including all variants:
- https://example.com
- https://www.example.com
- Enter one domain per line, including all variants:
- Save the configuration
How do I know if I executed this process correctly?¶
- Their websites can successfully send data to Mautic
- Tracking scripts load without CORS errors in browser console
- Visitors will start having a history of visited pages
Note
Adding all domain variants (with and without www) helps prevent common issues. While not the most elegant solution, it's more reliable than having to debug issues later.