Custom Domain Tab

Use a custom domain to host your SwaggerHub Portal from a domain fully under your control. Custom domains are available on the Enterprise Plan. Once configured, you can access the SwaggerHub Portal from the custom domain. An SSL certificate for your domain is automatically generated with Let's Encrypt.

Use the custom domain tab to:

  • Add custom domains.

  • Delete custom domains.

  • Control the URL structure and presentation of your Portal.

Note

Custom domains are not available to on-prem users.

Add Custom Domain

Create a CNAME DNS record for your domain that points to http://ingress-swaggerhub.com/ Verify that your CNAME is visible to everyone using Dig, Google's Admin Toolbox, MX Toolbox, or a similar tool. 

Example 

% dig +short -t cname my-api-docs.example.com
ingress-swaggerhub.com
    

If you have a CAA record for your domain, it must include letsencrypt.org. Using one of the tools mentioned in step 1, verify that your CAA change is visible to everyone. 

Example 

% dig +short -t caa my-api-docs.example.com
0 issue "letsencrypt.org"

Or you may have a CAA record for the "parent" domain:

% dig +short -t caa example.com
...
0 issuewild "letsencrypt.org"
...

Note

You must complete and verify the previous steps first. Don't skip ahead.

  1. Click Edit in the Custom Domain tab.

  2. Choose a domain name you want to use.

  3. Click Apply Changes.

Once you apply changes, you can navigate to the custom domain to test out the portal with custom domain.

Notice

SwaggerHub Portal currently requires the full domain to be allocated for use, which means that it's impossible to expose documentation from a single path or route. For example, the domain api.example.com can be used to host your documentation, however example.com/api can't (note the /api base path).

Remove Custom Domain

  1. Click Edit in the Custom Domain tab,

  2. Click the bin icon and confirm a custom domain removal in a dialog.

  3. Click Apply Changes.

    Note

    Remove the entries you made in Add Custom Domain. The change may take some time to propagate through the system.

Google Tag Manager

Google Tag Manager (GTM) is a free tool that allows you to manage and deploy marketing tags, such as analytic scripts, to your website. Google Tag Manager offers several built-in tags including Google Analytics, CrazyEgg, Hotjar, LinkedIn Insight, and more.

How It Works

Within your portal, you can associate your custom domain with your Google Tag Manager ID (GTM ID). When your portal is loaded from your custom domain, Google Tag Manger is included with your configured marketing tags.

Follow these steps to get started:

  1. Create a free Google Tag Manager account and copy your GTM ID (for example: GTM-XXXXX-X).

  2. Navigate to your portal configuration and your custom domain.

  3. Enter your GTM ID, and then save your changes.

Next, add marketing tags to your GTM account and they're included when loading your custom domain. Check out this guide to configure Google Analytics using GTM.

Publication date: