Send Events using Custom Domains

Implementing Angler tag using a custom subdomain

If you would like to use a custom domain to send events to Angler AI from your page, you would need to add a few DNS records for verification and routing. We would need 2 subdomains to be able to send data to our endpoint. The first subdomain is to load the library from our CDN and the other subdomain is to send data to our API.

For example, if your storefront domain is examplestore.com, you would need something like anglerlib.examplestore.com and anglerdata.examplestore.com. Once you know what subdomains you would like to use, please let your customer service representative know so that we can provision the values you need to add to your DNS. It will look something like this:

TypeHostValuePurpose
CNAME<TBD>.examplestore.com<TBD>Verify *.examplestore.com. Do not remove to automatically renew SSL certificate every year.
CNAME<TBD>.anglerdata.examplestore.com<TBD>Verify *.anglerdata.examplestore.com. Do not remove to automatically renew SSL certificate every year.
CNAMEanglerapi.examplestore.com<TBD>redirect anglerapi.examplestore.com to data.getangler.ai
CNAMEanglerdata.examplestore.com<TBD>redirect anglerdata.examplestore.com to static.getangler.ai

Once that is setup, you can use your domain to load the angler lib and send data to angler. Replace static.getangler.ai with anglerdata.examplestore.com to import the library. Example:

https://anglerdata.examplestore.com/dist/analytics/_latest.min.js

While initializing the angler sdk, add the domain parameter(without https) like this:

<script src="https://anglerdata.examplestore.com/dist/analytics/_latest.min.js">
</script>
<script>
	window.anglerai.init({workspaceId: "<WORKSPACE_ID>", token: "<TOKEN>", domain: "anglerapi.examplestore.com"})
</script>