OptinMonster makes it easy to use a custom sub-domain to link to the OptinMonster API, allowing you to load our script from your own sub-domain.
In this article, you’ll learn how to use Custom Domains with the OptinMonster API using your own sub-domain.
Before You Start
Here are some things to know before you begin:
- Custom Domains is a separate feature that can be added to any paid subscription plan.
- The custom domain is a subdomain of the site where you are enabling custom domains.
- This guide assumes you are already familiar with managing your domain through the registrar’s control panel.
- This guide assumes you are comfortable editing DNS zones for your domain.
- Due to the advanced nature of this feature we are not able to provide direct support in making changes to the DNS zones for your sub-domain. Your domain registrar may be able to provide direct assistance if required.
- For Cloudflare, when doing the verification process you must disable the Cloudflare proxy. It can be enabled again after verification has been successful.
Subscribe to Custom Domains
Custom Domains is a feature addon that can be attached to any paid subscription plan. To get started using Custom Domains you’ll need to first subscribe to it.
To purchase the Custom Domains feature, follow these steps:
- Navigate to the Account > Billing screen in your OptinMonster account.
- From the Additional Upgrades section, select the Add button next to the Custom Domains feature.
- Follow the prompts to complete the transaction.
- You are now ready to enable Custom Domains as shown in the next section of this guide.
Enable Custom Domains
The first step in using a custom sub-domain to link with the OptinMonster API is enabling the feature in your account.
To enable Custom Domains, follow these steps:
- Navigate to the Sites management screen from your OptinMonster account.
- Next, select the Edit button for the specific site you want to enable Custom Domains for.
- From the Site Edit screen, enable the Custom Domains option.
- Once enabled, additional information will appear on the Site Edit screen, like this:
- Two default sub-domains are shown. You can use those or set your own custom sub-domains. If you want to use the default sub-domains, you can save the settings now and proceed to the “Update API URLs” section of this guide.
- To configure custom sub-domains proceed to the next section.
Configure Custom Domains
To configure custom sub-domains for the Custom Domains feature, follow these steps:
- From the same Site Edit screen you enabled Custom Domains from in the previous section, select the Generate New CNAME link as shown below:
- A popup modal will appear where you can enter your Custom API CNAME.
Do not enter the full URL, enter only the sub-domain. For example, if your domain is mynetwork.com and you want the API URL subdomain to be your-custom-subdomain.mynetwork.com then on the popup you would enter your-custom-subdomain.
- When you’re finished, click Yes, I’m Sure to save and exit the popup modal.
- You can now select the Save Changes button on the Site Edit screen to apply your Custom Domains settings in OptinMonster.
- Proceed to the next section in this guide to update your domain DNS zones.
Note those two down, we will need those later.
Update DNS Zones
The final step in enabling Custom Domains for OptinMonster is to update the domain DNS zones through your domain registrar control panel.
How you access and the design of the registrat control panel may vary from registrar to registrar. We provide general information below on how to configure the DNS Zones and you will want to refer to your registrar’s official documentation on how to access and edit DNS Zones through their interface.
To update the DNS Zones for your domain, follow these steps:
- We provide two CDN URLs in the Site Edit screen that you would have been provided in the last step of the previous section in this guide, like this:
- api.optincdn.com
- a.optincdn.com
- You will need to point the newly selected subdomains to those URLs. There are two options for that:
- Hosting Panel DNS Zone editor
- Domain Panel DNS Zone editor
If you are using nameservers to point your domain to your hosting account, then you will need to use the Hosting Panel DNS Zone editor.
If you are using A record IP to point the domain, then you can use the Domain Panel DNS Zone editor.
Hosting Panel DNS Zone editor
- In your hosting panel, navigate to the DNS Zone editor.
- Create a new CNAME record where the Name is the full sub-domain you wish to use for Custom Domains. For example, if our sub-domain is myomapi.zombiecoder.xyz one of our CNAME records would appear as follows:
- It should look similar to this after adding the records:
Domain Panel DNS Zone editor
In every domain panel, there is a DNS zone editor so that you can set different entries for the domain you have with them. If you don’t use nameservers, then you can add your DNS entries there, the same thing was shown on the Hosting Panel DNS Zone editor section.
Here we are showing some popular domain providers’ panel, but the procedure is similar in almost every panel.
Cloudflare
This is a screenshot from Cloudflare.
In the first dropdown field, select CNAME; on the second field write the subdomain name down (without the main domain), on the third field write the API URL that OptinMonster gives you, and for TTL selection you can choose Automatic.
You will need to complete this process for both CNAME records.
GoDaddy
Here is a screenshot of the GoDaddy Domain DNS Zone.
Verify Custom Domain
The final step in using a custom sub-domain for the OptinMonster Custom Domains feature is to verify both sub-domains.
To verify the sub-domains, follow these steps:
- Navigate to the Edit Site screen for the domain you are enabling Custom Domains for as you did in the first section of this guide.
- Under the Custom Domains section, select the Verify button next to each sub-domain.
- When you’re finished, click the Save Changes button.
Update API URLs
Once Custom Domains is fully configured for your site, you can update the API URLs used in any embed codes on your site to reference your custom domains.
For example, the Global Embed code we automatically generate looks similar to the following:
<!-- This site is converting visitors into subscribers and customers with OptinMonster - https://staging.optinmonster.com --> <script>(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.account=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,00000,00000);</script> <!-- / https://staging.optinmonster.com -->
You would update the following URL to use your own custom sub-domain:
https://a.omappapi.com/app/js/api.min.js
Troubleshooting
I have changed my DNS, but the OptinMonster dashboard is not verifying.
After creating a new DNS entry or changing an existing entry, it may take up to 48 hours to reflect the changes. Usually, it happens within an hour, but sometimes it takes longer. If verification fails, you will want to wait a couple of hours and try again.
I’m using the WordPress plugin, do I need to do anything extra?
Be sure to visit the WordPress admin > OptinMonster > Campaigns screen and make some small update to any campaign. This can be changing the status from Published to Paused then back to Published even.
By making a small update it will trigger the plugin to update and capture the Custom Domain information from your account.
If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!
Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE! Click here to get started →