Before you can install Webchat on GoDaddy, you’ll need to create a custom code snippet.
To create the custom code snippet:
- If you haven’t already, copy the Webchat code to your clipboard.
- Open a text editor and paste your Webchat code.
- Copy the following code snippet to the text editor.
<script>
function insertJS() {
// eslint-disable-next-line
var body = window.parent.document.body;
var jsScriptNode = document.createElement('script');
jsScriptNode.setAttribute('type', 'text/javascript');
jsScriptNode.setAttribute('src', 'https://connect.podium.com/widget.js#API_TOKEN=YOURTOKEN');
body.appendChild(jsScriptNode);
}
var start = Date.now();
var interval = 9;function main() {
var body = document.body;
if (body) {
insertJS();
} else if (Date.now() - start > 10000) {
return null;
} else {
setTimeout(function () {
main();
}, interval);
interval *= 2;
}
// console.log(window.parent)
}
main();</script>
- Locate your Webchat API token and replace the place holder text with your token.
- Copy the custom code snippet code to your clipboard.
To install the Webchat code on GoDaddy:
- Sign in to your GoDaddy administration account.
- Select your website.
- Click Edit Website.
- At the bottom of your Home page, click Add Section.
- Select HTML and click Add.
- In custom code, paste the Webchat code.
- Set forced height to 1 pixels.
- Click Done.
- Click Publish.