Developer Center

Advanced JavaScript Configuration

The HTML snippet provided for installation includes only basic configuration, like your API key. There are a handful of other options you can use to configure the VigLink JavaScript library.

Most users will not need to use these options.

Options

key
Your VigLink API key, found on your account page.

required; string

api_url
The base URL for API calls. If you’re using your own CNAME for api.viglink.com, be sure to set this option to "//<your CNAME>/api".

optional; string; default: "//api.viglink.com/api"

cuid
If set, this value is included as the CUID when the library makes API calls on this page. See the revenue tracking and CUID documentation for details.

optional; string

enabled
Enable the library. When set to false, library initialization will be aborted immediately and no API calls will occur. When disabled, JavaScript API methods will work in a failsafe mode, so the user experience is not affected.

optional; boolean; default: true

reaffiliate
By default, VigLink will not modify links which are already affiliated. To force re-affiliation for a single page, set reaffiliate to true. If you'd like to force re-affiliation globally, you can make that change in your VigLink settings.

optional; boolean; default: false

Example

var vglnk = {
  key:  "88ac2a40e081e283ac504d1789d398ac",
  cuid: "abc123"
}