Script / SDK
Install script
To use our functionality on your site, you will need to add our script. Replace ´YOUR_COMPANY_ID´ with your company UUID.
<script type="text/javascript" src="https://headless.dialogtrail.com/static/sdk.js?id=YOUR_COMPANY_ID"></script>
We recommend adding it so it’s present on your entire site, this will bring out the full potential of our SDK.
Input variables
You can append different variables onto our script. You add them as query parameters, eg. https://headless.dialogtrail.com/static/sdk.js?id=YOUR_COMPANY_ID&VARIABLE_NAME=VARIABLE_VALUE
.
Variable name | Variable Type | Required | Affected systems | Description |
---|---|---|---|---|
id | string | Yes | All | Your companies uuid, can be found under company settings. |
placementId | string | No | All | A placements/popups uuid, this will force the SDK to load that specific item. |
placement | boolean | No | All | If false, the SDK won’t attempt to load placements/popups. |
debug | boolean | No | All | If true, the SDK will log certain actions to the console. Will also attempt to get the debug menu for guides. |
tracking | boolean | No | All | If false, will disable non essential tracking. Such as product clicks, add to cart and purchases. |
locale | string | No | Product guides | The locale you want to start guides with, eg. en_US . If empty, the SDK attempts to get the locale from your site. |
lang | string | No | Product guides | Same as locale , can be just en or US . |
extEmail | string | No | Popups | A users email address that can be used when sending data over webhooks. |
extPhone | string | No | Popups | A users phone number that can be used when sending data over webhooks. |
extId | string | No | Popups | A users id from another service that can be used when sending data over webhooks. |