Custom domain configuration

The default server-side tagging deployment is hosted on an App Engine domain. We recommend that you modify the deployment to use a subdomain of your website instead.

Map a subdomain to your app

  1. In the Google Cloud Console, navigate to App Engine > Settings > Custom Domains. Make sure you’re in the project that matches your container ID:
    GCP project selector, showing a sample Tag Manager container ID.
  2. Click Add a custom domain.
  3. If your domain is already verified, you may select it from the Select the domain you want to use section. Otherwise, select Verify a new domain from the drop-down menu. If you haven’t verified your domain, do the following:
    1. Enter your subdomain (such as metrics.example.com) and click Verify. A new Webmaster Central window will appear.
    2. To verify your ownership of your subdomain, follow the steps as prompted in Webmaster Central.
    3. After you complete the steps in Webmaster Central, close the window and return to the Add a new custom domain page in Google Cloud Console. You may need to click Refresh domains to see your newly verified domain.
  4. In the Point your domain to [project-ID] section, remove the www. prefixed subdomain and Save mappings.

Update DNS records at your domain registrar

After you've mapped your service to a custom domain in App Engine, update the DNS records at your domain registrar. As a convenience, App Engine generates and displays the DNS records you need to enter.

  1. To retrieve the DNS record information for your domain mappings, open the Custom Domains tab in Google Cloud Console. This page lists DNS records for all of the domains you have mapped to your app.
  2. Log in to your account at your domain registrar and open the DNS configuration page.
  3. Locate the host records section of your domain’s configuration page and add each of the DNS records that you retrieved when you mapped your domain to your app. Enter the following information in the record fields:
    • Record type: Enter the record type shown in the DNS record that Google created for you (A and AAAA).
    • Record name: For A and AAAA records, enter the subdomain you registered. For example, enter “metrics” to map metrics.example.com.
    • Data: Enter the record data (rrdata) that is shown in the DNS record Google created for you. For A or AAAA records, the record data is an IP address. If there is a CNAME record shown in addition to the A and AAAA records, do not map the CNAME record.
  4. Save your changes in the DNS configuration page of your domain’s account. In most cases, it takes only a few minutes for these changes to take effect, but in some cases it can take several hours. You can use dig to confirm the DNS records have been successfully updated.
  5. To test your subdomain, navigate to your server-side Tag Manager container under Admin > Container Settings. and paste that URL into the Server container URL. Click Save, navigate back to your workspace, then click Preview. You should see the Debug panel pop up.