Aliasing with a custom CNAME

You can mask the fact that you use VigLink's affiliation services by creating "alias" domains for VigLink's service-related host names, and making a slight modification to your VigLink JavaScript library initialization parameters. 

Any publisher can alias the API calls by creating a single CNAME and redirecting VigLink API calls to that name.  

Aliasing VigLink API Calls

To create the appearance that a page on your website calls publisher-provided services instead of VigLink’s service, use the following guidelines:

  • Create a DNS CNAME that points to api.viglink.com. We suggest using click.<publisherdomain>.com

  • Change the api_url parameter in the VigLink Javascript library initialization code on your pages to specify the alias domain name.

 An example altered initialization block is shown below:

 <script type="text/javascript">

  var vglnk = { api_url: '//click.mydomain.com/api',

                key: 'mypublisherkey' };

   (function(d, t) {

    var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;

    s.src = ('https:' == document.location.protocol ? vglnk.api_url :

             '//cdn.viglink.com/api') + '/vglnk.js';

    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);

  }(document, 'script'));

</script>  

 

A Note About SSL

These instructions apply primarily to non-SSL traffic. Aliasing SSL traffic is more complex because of the security protocols involved. VigLink does not currently support aliasing its hostnames for SSL (https) traffic. 

If your site supports SSL, the code snippet below will function—but viewers accessing the publisher site via SSL will see warnings in their browser.

 <script type="text/javascript">

  var vglnk = { api_url: '//click.mydomain.com/api',

                key: 'mypublisherkey' };

   (function(d, t) {

    var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;

    s.src = ('https:' == document.location.protocol ? vglnk.api_url :

             '//clickcdn.mydomain.com/api') + '/vglnk.js';

    var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);

  }(document, 'script'));

</script>

Have more questions? Submit a request

Comments

Powered by Zendesk