Using multiple custom domains

This article covers the use of multiple custom domains when distributing your survey via Agile Research. This only applies if you have at least two custom domains active for your account.

Use case

There are two domains, one for Dutch-speaking contacts and one for French-speaking contacts. Dutch survey takers should see custom domain 1; French survey takers should see custom domain 2. When used, test your survey before launching.

The default domain that is configured for this account is survey.domainA.com. I no CSL is used, this will always be used.The default from address is survey@domainA.com. You can use any valid email address in the from field of your email invitation if that domain is configured in the account (e.g., survey@domainB.com).

Context

You can use multiple custom domains in a single account by using using CSL. CSL will allow you to update the hyperlink in the email invitation based upon contact metadata. In this example, we do this based on the contact language, but you could use any other available contact metadata that is available. As a fallback, the default survey URL will be inserted in the email invitation. In this example, the default contact survey URL will be used when no contact language code is available.

This article will show you how to change the From address and Contact survey URL in the email invitation.

Email invitation From address

Change the from address and reply address in the email invitation by the one from the custom domain. In this example, there will be a different email address in the NL version than the FR version. To be able to send the email invitation from the specified survey domain, both the From as the Reply to email address need to be the same.

To edit this, go to Distribute > Email > Email invitation. Change both the From and Reply address in the email invitation. You can do the same for the email reminders.

Email invitations.

Now switch the language to change the the From and Reply address in the email invitation of surveys in other languages.

Languages.

Survey URL

The survey URL needs to be altered using CSL. We will be using the replace CSL operator to update/replace the contact survey URL variable that is used in the email invitation to dynamically populate the unique survey URL for each email invitation that is sent out to your contacts. By default, it will use the domain that is configured for your account.

In this CSL code, we will replace the main domain (domainA.com) for the FR contacts by domainB.com. The CSL code will replace what is specified depending on the contact language code if present. If nothing is present in the contact metadata, the default survey domain will be used.

{{#if (eq contact.language.code 'fr')}}
  {{replace contact.surveyUrl 'survey.domainA.com' 'survey.domainB.com'}}
{{else}}
  {{contact.surveyUrl}}
{{/if}}
Update the URL
In the email invitation:
  1. Click the text / button that says Start here.
  2. Click the link icon in the toolbar of the email editor.
  3. Replace the {{contact.surveyUrl}} by the CSL snippet above. In this case, when the contact has language code FR, it will replace survey.domainA.com with survey.domainB.com.
  4. Repeat this for every language where this is needed.
At the bottom of the email invitation, we also have the 'If the link does not work…' text where the full survey URL is shown that the recipient can copy/paste into their browser. Repeat the steps from above.
Note: When embedding a question in the email invitation, make sure that you update all used links in the email invitation. This is important because when the email invitation has different links, this could potentially trigger spam filters.
Survey URL to distribute

Select the base domain in the distribution channel (e.g. Distribute > Web > URL / Social Media) and use the survey URL.

Survey URL.

Note: Always test this before launching your survey to your audience. You can test the survey as a contact.