Setup Instant Double Opt-In Inside Mautic

Double opt-in is more important now than ever. From keeping your email list clean, to having a superior email sending reputation for your domain, to complying with GDPR, CCPA, and whatever regulation comes next, double-opt in is in demand.

However, Mautic doesn’t give you any preconfigured system for this purpose. The way to setup a double opt-in isn’t very streamlined either.

As a result, you may just end up with a messy campaign inside Mautic that makes your users wait like 15 minutes before they get your double opt-in email in their inbox after signing up on your website.

And maybe another 30 minutes that you need to wait before being able to track their click on the double opt-in link inside the email. Making the whole process very inefficient and losing a significant portion of your already signed-up users in the process.

These delays happen because of the interval between each cron jobs that Mautic uses to function properly. That is to say, this waiting time may be lower or significantly higher based on your setup of the cron jobs.

These are some concerns I had to deal with as well. So, after figuring out how to make double opt-ins instant inside Mautic, I am writing this guide to remind myself of the process in case I ever need to do it again, which I am pretty sure of needing to do again.

Here is the secret for instant double opt-in inside Mautic:

  • Use standalone form instead of campaign form to instantly send double opt-in emails.
  • Add a Mautic variable as query string at the end of your double opt-in confirmation page URL.
  • Use tags alongside page visit decision to instantly track when double opt-in links are clicked.
    (using tags doesn’t seem to be necessary for instant tracking of double opt in status. because instead of needing to wait for the cron jobs to trigger the campaigns and therefore the page visit decision, page visit decisions for email link clicks gets evaluated as soon users click the confirmation page link from inside the confirmation email sent to them)

Steps Summary:

  • Create two segments one for people that are pending double opt in confirmation, and another for people whose double opt is has been confirmed. Let’s say these two segments are called DOI Pending Segment and DOI Confirmed Segment respectively.
  • Create a landing page, say, DOI Confirmation Page that when visited by anyone from DOI Pending Segment will help move them to the DOI Confirmed Segment.
  • Create a template email, say, DOI Confirmation Email and add the DOI Confirmation Page link in the email body. This email will help people visit the DOI Confirmation Page and therefore confirm their email address.
  • Create a standalone form, say, DOI Form, that does two actions when submitted by your visitors. First action is to add the form submitter to the DOI Pending Segment and the second action is to send the DOI Confirmation Email to the form submitter.
  • Create a campaign, say, Confirm DOI Campaign with a Visits a page decision that moves anyone from DOI Pending Segment that clicks on the DOI Confirmation Page link to the DOI Confirmed Segment.

In short, somebody submits his email address in your DOI Form. He then immediately gets added to the DOI Pending Segment and receives the DOI Confirmation Email in his inbox. The Confirm DOI Campaign also gets triggered at this time because of his addition to the DOI Pending Segment. Then as soon as the form submitter clicks on the DOI Confirmation Page link from his confirmation email, Visits a page decision from the Confirm DOI Campaign gets triggered and is evaluated to true. Therefore the contact gets moved from DOI Pending Segment to the DOI Confirmed Segment.

Here is a step by step process of how to do these:

1. Create Segments for Double Opt-In Stages

To keep track of which contacts are pending double opt-in confirmation and which contacts are already confirmed, you will need to have two different contact segments.

Click on Segments from the left side menu of Mautic dashboard to start working with contact segments. Then create the following two segments:

1.1 Pending Double Opt-In Contacts Segment

Click on the New button to create a new segment for contacts that are pending double opt-in verification. Then give this segment a name like DOI Pending to easily identify this contact segment later on.

Now make sure the segment is published then Save the segment.

1.2 Confirmed Double Opt-In Contacts Segment

Now, you will need to create another segment for contacts that have confirmed their double opt-in verification. So, go back to the Segments page and click on the New button.

Then give this segment a name like DOI Confirmed to easily identify this contact segment later on.

Now make sure the segment is published then Save the segment.

Though instead of using these segments, you could check for the DOI tag of your contacts to perform certain actions, you would still need to use a segment if you wanted to start a new campaign from your double opt-in users. That’s why creating a confirmed double opt-in contacts list is important.

2. Create Confirmation Page

To complete the double opt-in verification, you will need to send emails with a verification link. So that when the users click on the link and goes to your verification page, you know that they visited the page and therefore make their double opt-in verification status confirmed.

For this to happen, you will need to create a verification page. Mautic has a built in landing page builder in Components > Landing Pages from its left side menu. You can use this landing page builder or use a different website builder of your choice like WordPress to create your double opt-in verification page.

If you built your double opt-in verification page using Mautic, you can use that page. Alternatively, you can use any webpage URL if you built you confirmation page in either Mautic or any other platforms. Wildcards can also be used to identify the page URL.

You can also use query strings at the end of your generic pages like homepage instead of using a dedicated confirmation page. Either way, use this page, page URL, or query string only for verifying double opt-ins. Otherwise, anyone visiting these links will have a chance to be marked as double opt-in confirmed even when they aren’t intending to do so.

Say, you are using a dedicated page for double opt in verifications and the page URL is https://example.com/verification.

3. Create Email For Double Opt-In Verification

Go to Channels > Emails from your Mautic dashboard. Then click on the New button to create a new email. From the pop-up window that appears, select New Template Email. This option will allow sending this email as a successful form submission action.

Now create the email that you want to send for double opt-in verification. Make sure to add your previously created double opt-in confirmation page link in the email. So that when the users click on the link and goes to the confirmation page, their double opt-in status can be updated to be confirmed.

Higher Accuracy

You have the option to either send this email to users as soon as they submit your form or add this email as part of your campaign so that the email gets sent when the campaign gets run. Choosing the latter will make your emails to wait before they can be sent by your campaigns based on the specified cron jobs.

So, for instant double opt in, we will need to send the email as a successful form submission action. However, sending emails this way compared to sending from campaigns comes with a drawback. That is you can’t directly make any decisions and mark people’s double opt in status to be confirmed when they click on the confirmation page link from the confirmation email.

As a result, you will have to track visitors that come to your confirmation page, and mark their double opt in status to be confirmed. But the problem with this approach is that you wouldn’t know whether the visitors came to the confirmation page by clicking on the confirmation page link from the confirmation email sent to them. Therefore, anyone visiting this page will have a chance to be marked as double opt-in confirmed even when they aren’t intending to do so.

To solve this problem, a query string with a Mautic variable can be used at the end of your confirmation page URL. Let me explain.

When you enter any link in your emails or landing pages that you create using Mautic, those link clicks will be automatically tracked by Mautic. As in, Mautic, under the hood, will replace your entered link in the email or landing page with a hashed link and when that hashed link is clicked, Mautic will count a link click for your entered link and then redirect the user from the hashed link to your entered link. As a result even if you don’t have a Mautic tracking pixel or tracking image setup on the entered link or even if the entered link doesn’t exist entirely, Mautic will still be able to identify any click to the link. Because as far as Mautic is concerned, a click on the hashed link is equivalent to a click on your entered link.

We can use this feature for proper double opt in verification by adding a Mautic variable like {contactfield=id} in a query string at the end of your verification page URL. Mautic will then replace this variable with the actual contact ID which is say 1. This way, when anyone clicks on the verification page URL from his email, Mautic will only register a link click for {contactfield=id} and not for its actual value which is 1.

To implement this in your double opt in confirmation page URL, add a query string containing that variable. The query string will basically look something like this ?doi={contactfield=id}. You can change this in any way you want but the important part is keeping a variable in there which will be replaced by its actual value by Mautic. You may also want to check more details about adding query strings properly so that it works as expected. You can also take a look at this page to see a list of more of these variables https://docs.mautic.org/en/setup/variables.

So, if your confirmation page URL is https://example.com/verification, it will finally become like this https://example.com/verification?doi={contactfield=id}.

This will prevent Mautic from marking people as double opt-in verified if they aren’t coming to the confirmation page directly from their double opt-in confirmation email.

Additionally, when you create emails in Mautic and send them to your users and then any user clicks on any links in the emails, the user will be automatically identified by Mautic as the user to whom the email was sent. So, even if a user submits your form from say his laptop and then opens the verification link from his phone, Mautic will be able to correctly identify the user on both these devices. As a result when the user next visits your website either from his laptop or phone, he will be correctly identified in both these devices.

After you are done with creating your confirmation email, make sure the email is published and then save the email.

4. Create Standalone Form

From the left side menu on your your Mautic dashboard, go to Components > Forms.

Now, click on the New button from the top right side. Then from inside the New Standalone From section, click on Select. This form type will enable sending out emails to anyone as soon as they successfully submits the form. This way the double opt-in verification emails can be sent immediately without needing to wait until when your campaigns run.

This will open up your form editing menu. Now, first of all, make sure that under the Category section on the right hand side, Published is set to Yes.

Then fill up the fields under the Details tab however you want. Also, under the Fields tab, add your input fields the way you want them to be.

Now, under the Actions tab, you will need to add two different actions as follows:

4.1 Modify contact’s segments

To add a successful form submission action, select Modify contact’s segments from the dropdown list in the Actions tab.

In the popup window, for the Add contact to selected segment(s) field, select the segment that you previously created for users that are pending double opt-in verification.

4.2 Send email to contact

Add a second successful form submission action, select Send email to contact from the same dropdown list as the previous one. This will enable sending an email instantly to anyone that fills up and submits the form without needing to wait for any cron jobs.

In the popup window, for the Email to send field, select the email that you previously created for using as the double opt-in confirmation email.

You are now done with the form customization so you can Save the form and follow the next step.

5. Create Campaign for Double Opt-In Verification

Now you will need to using a campaign to move everyone that clicks on your confirmation page URL from their confirmation email to the segment you created for double opt in confirmed users.

From your Mautic dashboard, click on Campaigns from the left hand menu. Then click on the New button to get started with a new campaign.

Give your campaign a name then make sure your campaign Published status is set to Yes. Then click on the Launch Campaign Builder button to start setting up your campaign.

Now for the Contact Sources field, select Contact segments. Then select the segment that you previously created for contacts that are pending double opt-in verification. This segment was previously named DOI Pending. Then click on the Add button.

For the next campaign step, we will have to choose the right one between condition and decision.

Condition in Mautic is used to check for the current state of something meaning events that have happened in the past. On the contrary, decision in Mautic doesn’t check for current state but waits for future events to happen. Therefore, the usage of these two are different.

So, add a Decision to move people from DOI Pending segment to the DOI Confirmed segment if they visit the DOI confirmation page. In the decisions dropdown, select Visits a page. Then if your confirmation page was built using the landing page builder of Mautic, in the Limit to Pages field, select your confirmation page. But if your page was built using a different platform other than Mautic, in the URL field, add the URL or the link of your double opt-in confirmation page. Then click Add.

Note: If you used the previously mentioned approach of adding the query string ?doi={contactfield=id} at the end of your confirmation page URL for higher accuracy, you can also add this part to the URL in your visits a page decision. But be sure to URL encode this part which will make it ?email=%7Bcontactfield%3Demail%7D. This will ensure only people that clicks on the confirmation page URL from the DOI confirmation email sent to them gets their double opt in status verified.

Now add an Action if the decision evaluates to true. From the actions dropdown, select Modify contact’s segments. Then for the Add contact to selected segment(s) field, select the segment that you your previously created for contacts that have confirmed their double opt-in verification. This segment was previously named DOI Confirmed. And for the Remove contact from selected segment(s) field, select the DOI Pending segment. Then click on the Add button.

This much is enough for your simple instant double opt-in campaign. If you want to add additional steps, you can do so as well. For instance, you may send a reminder email after a day if the previous decision doesn’t evaluate to true by then, remove contact from segment if double opt in isn’t confirmed within the next week, and do a lot of other things as per your need. Anyway, you have successfully created your double opt-in campaign at this point.

You may want to read this guide to properly setup your Mautic cron jobs so that all your campaigns and other things runs smoothly on Mautic.

Leave a comment

Your email address will not be published.