Custom Tracking Domain Set Up For Shared Instance

This feature is currently in Beta version.

Follow the steps below to set up a custom tracking domain (CTD) for shared instances. For more information about how it works see custom tracking domain (CTD) article.

🚧

Not available on all shared instances

This feature is still in BETA and is not yet available on all shared instances. If you don't see the custom tracking domain setting in your project and you are interested in this feature, please contact your CSM.

1. Create subdomain and set DNS CNAME record

Create a subdomain of your website e.g. analytics-api.yourdomain.com and set the DNS CNAME record to point to our custom tracking destination domain e.g custom-api.exponea.com. The exact destination domain will differ based on the instance. You can find it in the Project settings of your Exponea project.

CNAME example:

Your SubdomainRecord TypeDestination DomainTTL
analytics-api.yourdomain.comCNAMEcustom-api.exponea.com86400

2. Find Custom tracking domain in Project settings

Go to Project settings -> General -> General project settings as seen in the picture below

3. Find the Custom tracking API for the DNS CNAME records

4. Add Custom Domain(s)

Insert custom domain (or multiple domains, if you are tracking multiple domains in a single project); this will not impact your existing tracking, only add another option.

4. Save and check

Save changes and check whether your custom domains passed CNAME validation and were saved correctly. If there is a green checkmark next to your domain you are good to go.

5. Update your tracking snippet.

There are two places where the snippet needs to be updated. You can update the snippet directly using the instructions below or look into the Web Integration tab where, once the CTD is set up, you can find the updated snippet. In case you have multiple custom domains in one project, follow the steps below.

📘

When updating the snippet be careful to keep all your existing configuration of the initialization unchanged.

  • 1. JS SDK link
    Look for the link to exponea.min.js in the initialization snippet and replace the JS SDK domain to your custom tracking domain.
    Example:
    Change from
    //api.exponea.com/js/exponea.min.js
    to
    //analytics-api.yourdomain.com/js/exponea.min.js
<script>
(function(b,c){
...a.src=g+"//analyticsapi.yourdomain.com/js/exponea.min.js";...
})(window,document);
</script>
  • 2. Tracking API target
    Add the "target" parameter to your initialization config and set it to your custom domain
    e.g. "target" : "https://analytics-api.yourdomain.com
<script type="text/javascript">
    exponea.initialize({
        "target": "//analytics-api.yourdomain.com",
        "token": "<project_token>",
        ...
    });
</script>
  • 3. Non-flickering experiments API path
    In case you are using non-flickering experiments update the “path” parameter in their initialization config and set it to your custom domain
    e.g. webxpClient.path = https://analytics-api.yourdomain.com
<script>
    webxpClient.path = 'https://analytics-api.yourdomain.com';
    webxpClient.sign = '<PROJECT-TOKEN>' + '/' + 
    ...
</script>

6. Make sure everything is working

Visit your website and make sure everything is working (events are being tracked, weblayers displayed…). If you are using our Exponea console Chrome extension don’t forget to add your new domain to the API endpoint list otherwise you won't see any events in the console.

Updated 20 days ago


Custom Tracking Domain Set Up For Shared Instance


This feature is currently in Beta version.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.


We rely on cookies

to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

Manage cookies
Accept & close

Cookies preferences

Accept & close
Back