Mautic Integration

This will show you how to integrate Mautic to your OptimizePress 3.0 site using  OAuth 2 Authorization protocol.

1. Create API credentials

Go to Mautic Configuration / API settings and set ‘ API enabled’ and ‘Enable HTTP basic auth’ to Yes. Save changes.

t the right side menu, click on the menu item ‘API credentials. And click on the “+ New” button to generate new API Credentials Key pair.

Select “OAuth 2” from the Authorization protocol select box, Choose the name for your Credentials and type your domain inside the “Redirect URI” field. Please note that the link needs to contain protocol (e.g. http:// or https:// ) and must not end with /. Click the Apply button.

Client ID and Client Secret are generated. Copy them because we will need them in the next step.

2. Create new Integration

Hover the OptimizePress 3.0 panel, and choose Integrations. Then click Add New Integration.

From the list of integrations, pick on the Mautic, and click on the Enter Credentials button.

Paste the  Client ID you have generated in the previous step into the Public Key field, and then paste Client Secret into the Secret Key field. Under Mautic Instance URL enter the domain on which your Mautic installation is it is located. Please note that the link needs to contain protocol (e.g. http:// or https://) and must not end with /.

You will first be prompted to enter your credentials…

and then to authorize the connection.

Click the Accept button.

3. Clear the cache

After you successfully connect to your Mautic installation, it is necessary to clear the cache. There are several ways to do that. The easiest is to go to the
/var/cache folder on your Mautic installation and delete its content. If you want to do it via CLI command, navigate to the Mautic root folder and run
rm -rf var/cache/*. The new cache files will generate themselves after the next Mautic refresh in the browser.
It might happen that the files won’t generate themselves. It can be caused by the wrong folder permission and Mautic doesn’t have permission to write the new cache files. Contact your sysadmin and ask them to fix it for you.

4. Regenerate the database schema

Go to
http://[your-mautic-url]/s/update/schema. It will update your database schema if there are some known updates to be applied.

This concludes our guide on setting up Mautic with OptimizePress. If you need further help please contact our support team.

5. Create a campaign

If you already have a working campaign form, you can skip this step, otherwise, you will need to create at least one campaign form for your Mautic installation to work properly.

You need to create a campaign form, (not a standalone form), then add fields to it.

When you create a form, you need to select the campaign form.

Add some fields to your campaign form.

Add a form as Campaign Source

Click the Update button.

Troubleshooting Mautic

Mautic can sometimes be a little tricky because you are self hosting their platform, so your individual hosting configuration for your server where Mautic is hosted can affect how this works.

Error on Form Fields Screen (401 rest_forbidden error)

If you receive an error on the Form fields screen – either the integration gets stuck or you see the following error in the browser console:

To fix this, we have found you may need to downgrade the version of your PHP on your Mautic server to 7.3

Error when connecting

When connecting your integration, ensure you do not have a trailing slash / at the end of your site url in our Mautic integration field. This can cause a problem with the connection as it means you have a double slash in the URL //

Updated on November 28, 2022

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
Contact Support