Skip to Content
Mux Docs: Home

Integrate a Data custom domain

Learn how to integrate a Data custom domain for beacon collection.

In this guide you will learn how to configure a custom domain used for submitting Mux Data beacons from SDK clients. Video view data will be sent to the specified custom domain rather than the default Mux domain.

You might choose to do this for a couple of reasons, such as allowing analytics traffic to bypass school or other network firewall restrictions (via a known domain), zero-rating this traffic, or to aid tracking performance when ad blockers are in place.

Custom Domains for Mux Data are available on select plans, such as Mux Data Media. Reach out if you have any questions.

1Point your custom domain to the Mux domain

After selecting your desired custom domain, you will need to create CNAME records with your DNS provider to alias the custom domain to a Mux-controlled one and allow Mux to issue TLS certificates for your selected domain. After providing your Customer Success Manager with the desired subdomain, Mux will provide you with the specific required DNS records to enable custom domains (including the value for {KEY} below). The records will have the following basic format: 300 IN CNAME ${KEY} 300 IN CNAME ${KEY}

Notify Mux after these records have been created so we can issue TLS certificates to terminate beacon traffic sent to your selected custom domain. You will be notified by Mux when the domain has been successfully provisioned.

2Configure your SDK integration to use a custom beacon domain

You can verify whether the custom domain is operational by using curl to query your domain:

$ curl -s -w "%{http_code}"

Make sure that you have upgraded to the latest versions of each SDK to ensure Custom Domains function correctly.

It may take some time for DNS records to propagate before this request will work. After that is complete, configure your SDK integrations to specify your custom domain. Set the beaconCollectionDomain property to your custom domain.

Depending on your SDK, you can set the value for beaconCollectionDomain in various ways.

m.mux ="mux")
muxConfig = {
env_key: "ENV_KEY",
beaconCollectionDomain: "CUSTOM_DOMAIN"
m.mux.setField("config", muxConfig)
m.mux.control = "RUN"

Was this page helpful?