html code

This topic contains 4 replies, has 3 voices, and was last updated by  Alex Rollin 6 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #463633

    Leonardo Guastella
    Expired Member
    Post count: 164

    have to insert a html code for a chatbot widget
    i tried the snippet tool but keep getting errors
    what shall i do?
    thanks

    <div class=”fb-chat-wraper-qwerttefgsd” id=”chat-fb”></div> <script> “use strict”; function chatWidget() { function getCookie(name) { var matches = document.cookie.match(new RegExp(“(?:^|; )” + name.replace(/([.$?*|{}()[]\/+^])/g, ‘\$1’) + “=([^;]*)”));return matches ? decodeURIComponent(matches[1]) : undefined; } var anonymousID = getCookie(“anonymousID”); if (anonymousID) { var chatFb = document.getElementById(‘chat-fb’); var ref = “”; var traits = { anonymousID: anonymousID, payload: ref }; traits = JSON.stringify(traits);traits = btoa(traits); var newRef = ‘base64_’ + traits; var el = document.createElement(‘div’); el.className = ‘fb-customerchat’; el.setAttribute(‘page_id’, 1885401931478880); el.setAttribute(‘ref’, newRef); el.setAttribute(‘theme_color’, ‘#0184ff’); el.setAttribute(‘logged_in_greeting’, ‘Search for products here’); el.setAttribute(‘logged_out_greeting’, ‘Look for products here’); el.setAttribute(‘greeting_dialog_display’, ”); el.setAttribute(‘greeting_dialog_delay’, ”); document.querySelector(‘.fb-chat-wraper-qwerttefgsd’).appendChild(el); FB.XFBML.parse(); } else { var _chatFb = document.getElementById(‘chat-fb’); var _ref = “”; var el = document.createElement(‘div’); el.className = ‘fb-customerchat’; el.setAttribute(‘page_id’, 1885401931478880); el.setAttribute(‘ref’, _ref); el.setAttribute(‘theme_color’, ‘#0184ff’); el.setAttribute(‘logged_in_greeting’, ‘Search for products here’); el.setAttribute(‘logged_out_greeting’, ‘Look for products here’); el.setAttribute(‘greeting_dialog_display’, ”); el.setAttribute(‘greeting_dialog_delay’, ”); document.querySelector(‘.fb-chat-wraper-qwerttefgsd’).appendChild(el); FB.XFBML.parse(); } } window.fbMessengerPlugins = window.fbMessengerPlugins || { init: function () { FB.init({ appId : ‘345027132667121’, autoLogAppEvents : true, xfbml : false, version : ‘v3.0’ }); chatWidget(); }, callable: [] }; window.fbAsyncInit = window.fbAsyncInit || function () { window.fbMessengerPlugins.callable.forEach(function (item) { item(); }); window.fbMessengerPlugins.init(); }; setTimeout(function () { (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = “https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js”; fjs.parentNode.insertBefore(js, fjs); }(document, ‘script’, ‘facebook-jssdk’)); }, 0); </script>

    #463646

    Guust
    Moderator
    Post count: 29970

    Please seek assistance of the plugin or software developer of that chatbox, that is not a GD product.
    Thanks

    #463657

    Leonardo Guastella
    Expired Member
    Post count: 164

    ok i thought it was just a matter of pasting and it would work

    #463939

    Leonardo Guastella
    Expired Member
    Post count: 164

    Anything you can tell me the best way to add this code to the body of my webpage?

    #463943

    Alex Rollin
    Moderator
    Post count: 27815

    No, you need to contact the plugin or service about how to add the script.

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount