{"versionId":"10c26908-878e-49e1-e64a-08de86ffa464","articleId":"727b21f8-f5c1-43b5-97c6-08dad11575da","title":"Adding the chat widget to your website","tags":["technical","technology","chatbot basics","integrations","All articles"],"content":"<html><head></head><body><div>\n<div>\n<div class=\"mce-toc\">\n<h2>Table of Contents</h2>\n<ul>\n<li><a href=\"#mcetoc_1gj0mace3139\">Integrating Helpfruit into your website</a>\n<ul>\n<li><a href=\"#mcetoc_1gj0mace313a\">Basic integration: add Helpfruit chatbot to your website</a></li>\n<li><a href=\"#mcetoc_1gj0mace313b\">How to install a Helpfruit&nbsp;chatbot on Webflow</a></li>\n</ul>\n</li>\n<li><a href=\"#mcetoc_1gj0mace313c\">Installing a Helpfruit chatbot with Google Tag Manager</a>\n<ul>\n<li><a href=\"#mcetoc_1gj0mace313d\">How to add your chatbot to your site using Google Tag Manager</a></li>\n<li><a href=\"#mcetoc_1gj0mace313e\">How to ensure your chatbot is only displayed on certain pages of your website</a></li>\n<li><a href=\"#mcetoc_1gj0mace313f\">Delaying the chat widget load using Google Tag Manager</a></li>\n</ul>\n</li>\n<li><a href=\"#mcetoc_1gj0mace313h\">Add&nbsp;buttons or links to your webpage</a></li>\n</ul>\n</div>\n<p>Learn how to add a Helpfruit chatbot to your website with just 2 lines of code or with Google Tag Manager, and create interactions between your website and your chatbot.</p>\n</div>\n</div>\n<div>\n<h2 id=\"mcetoc_1gj0mace3139\">Integrating Helpfruit into your website</h2>\n<p>Adding the Helpfruit chat widget to your website is as easy as adding something like Google Analytics. If you’re familiar with adding similar scripts to a web page or content management system like Webflow it’s no more than a 5 minute job ⚡️&nbsp;</p>\n<p>Google Tag Manager is another option, allowing more advanced control over the display of your chatbot at a page level, and allowing you to delay the chatbot loading, which can help improve the perceived performance(especially on mobile).</p>\n<p>You can also build interactions (eg via button or link) between your site and your chatbot. This can be a great way to provide on-page help, initiate <a href=\"https://help.faqbot.ai/article/live-chat\" target=\"_blank\" rel=\"noopener\">live chat</a>, or use a <a href=\"https://help.faqbot.ai/article/forms\" target=\"_blank\" rel=\"noopener\">conversational form experience</a> to capture leads.</p>\n<p>In this help article we’ll show you how - &nbsp;from basic bot integration to more advanced interactions.</p>\n<h3 id=\"mcetoc_1gj0mace313a\">Basic integration: add Helpfruit chatbot to your website</h3>\n<p>For a simple setup all you need to do is add two lines to your website on all pages you want the bot to appear. &nbsp;</p>\n<p>The first line is an HTML DIV element which is added inside the &lt;body&gt; tag. Just above the closing &lt;/body&gt; tag is a good spot. &nbsp;The second line is a link to a JavaScript file. This is added straight below the div (also inside the &lt;body&gt; tag).&nbsp;</p>\n<p>Most content management systems will let you add code like this in one place, which will reflect across all pages. &nbsp;</p>\n<p>Here is an example:</p>\n<code>&lt;html&gt;</code><br><code>&nbsp; &nbsp;&lt;body&gt;</code><br><code>&nbsp; &nbsp; &nbsp; &nbsp;&lt;!-- rest of your page content&gt;</code><br><code>&nbsp; &nbsp; &nbsp; &nbsp;&lt;div id='bot-id-<strong>xxxx</strong>'&gt;&lt;/div&gt;</code><br><code>&nbsp; &nbsp; &nbsp; &nbsp;&lt;script src='<a href=\"https://portal.faqbot.nz/api/v1/scripts/xxxx/js/corejs\">https://portal.helpfruit.com/api/v1/scripts/xxxx/js/corejs</a>' async&gt;&lt;/script&gt;</code><br><code>&nbsp; &nbsp;&lt;/body&gt;</code><br><code>&lt;/html&gt;</code>\n<p>The bot subscription key (<strong>xxxx</strong> above) is specific to your account, and can be found on the Widget Setup tab in the Helpfruit portal.&nbsp;</p>\n<p>You can <a href=\"https://help.faqbot.ai/article/bot-styling\" target=\"_blank\" rel=\"noopener\">change the colours of the chat widget and other styling options</a> from within the Helpfruit portal too. That’s all you need to do! &nbsp;</p>\n<h3 id=\"mcetoc_1gj0mace313b\">How to install a Helpfruit&nbsp;chatbot on Webflow</h3>\n<p>Webflow is a widely used content management system, and installing your chatbot&nbsp;on Webflow is straightforward.</p>\n<p>First grab your DIV and Script code lines from the Helpfruit portal – see above - and then open your project in Webflow.</p>\n<p>Head to the Project Settings area and go to the “Custom Code” tab:</p>\n<figure>\n<div><img style=\"width: 576px;\" src=\"https://assets.website-files.com/610329b90a72af108e6cc634/6114a935f46d3b4b3eb24778_Screen%20Shot%202021-08-12%20at%204.45.54%20PM.png\" alt=\"\" loading=\"lazy\"></div>\n</figure>\n<p>Then in the footer section add the code into the “before &lt;/body&gt; tag” section. &nbsp;</p>\n<figure>\n<div><img style=\"width: 576px;\" src=\"https://assets.website-files.com/610329b90a72af108e6cc634/6114a8a373d3cc3e50c869d9_Screen%20Shot%202021-08-12%20at%204.47.13%20PM.png\" alt=\"\" loading=\"lazy\"></div>\n</figure>\n<p>Save your changes and publish the site. You can also use Google Tag Manager ⬇️</p>\n<h2 id=\"mcetoc_1gj0mace313c\">Installing a Helpfruit chatbot with Google Tag Manager</h2>\n<p>Google Tag Manager is a common way to manage all the scripts like ad conversion trackers and other things that load on a website. Google Tag Manager makes it easy to add your chatbot to all pages on your site, just some pages, or control other aspects such as delaying the load. &nbsp;If you don’t know how to use GTM then first start with&nbsp;<a href=\"https://support.google.com/tagmanager/answer/6102821?hl=en&amp;ref_topic=3441530\">their getting started information</a>.</p>\n<h3 id=\"mcetoc_1gj0mace313d\">How to add your chatbot to your site using Google Tag Manager</h3>\n<ol role=\"list\" start=\"\">\n<li>Open your workspace and add a new Tag</li>\n<li>Name it “FAQ Bot load”</li>\n<li>Click “Choose a tag type” and select “CustomHTML” from the list</li>\n<li>Copy the DIV and Script tag information from the Helpfruit&nbsp;portal (see first section above) and paste this into the custom html area</li>\n<li>In the Trigger section, click ‘choose a trigger’ and select your trigger that fires on all pages. Normally you will have created one of these already for other scripts. If not, select ‘+’ from the top right, add a new ‘page view’ type trigger, select “All Pages views” as the option and save it with a clear name like “All Pages”.&nbsp;</li>\n</ol>\n<p>Your tag should look something like this (with real IDs not XXXX):</p>\n<figure>\n<div><img style=\"width: 576px;\" src=\"https://assets.website-files.com/610329b90a72af108e6cc634/6114a9621944d21a0a6ef872_Inject%20FAQ%20Bot%20GTM%20(1).png\" alt=\"\" loading=\"lazy\"></div>\n</figure>\n<p>Save and publish your new tag.</p>\n<h3 id=\"mcetoc_1gj0mace313e\">How to ensure your chatbot is only displayed on certain pages of your website</h3>\n<p>Instead of using an “All Pages” trigger, you can make other trigger variations that only load the bot on some page urls or exclude certain pages urls. Google has good help on setting up triggers.</p>\n<h3 id=\"mcetoc_1gj0mace313f\">Delaying the chat widget load using Google Tag Manager</h3>\n<p>Any script added to your website will slow it down a little and that’s also the case for FAQ Bot. We cache and minimise the code to make it load fast, but there is a limit to how quickly any chat widget will load – including ours. The good news is that you can use Google Tag Manager to delay loading the chat widget until after the page has loaded by completing these three steps:</p>\n<ol role=\"list\" start=\"\">\n<li>Make a new tag that has a little bit of code in it. This code creates an ‘event’ that is fired a few seconds after the page has finished loading. &nbsp;</li>\n<li>Make a new trigger that listens for this event</li>\n<li>Update the FAQ Bot tag so that it uses this event trigger instead of a page view trigger.</li>\n</ol>\n<p>For instructions on how to create these tags, including the code you need to add, see the&nbsp;<a href=\"https://www.analyticsmania.com/post/google-tag-manager-impact-on-page-speed-and-how-to-improve/#delay\" target=\"_blank\" rel=\"noopener\">“Delay Tags” section of this blog post</a>. &nbsp;</p>\n<p>Experiment with the delay – you may find increasing the delay to 3 seconds will improve Page Speed scores. There is a trade-off as delaying the widget load by too much means users can’t start chatting immediately.&nbsp;</p>\n<h2 id=\"mcetoc_1gj0mace313h\">Add&nbsp;buttons or links to your webpage</h2>\n<p>You can also add buttons or links to your website that will open your chatbot and ask a question or trigger an engagement. <strong><a href=\"https://help.faqbot.ai/article/build-interactions-between-your-site-and-your-bot\" target=\"_blank\" rel=\"noopener\">Learn how</a></strong>.&nbsp;</p>\n</div></body></html>","description":"How to add the Helpfruit chat widget to your website.","isMarkdown":false,"publishedOnUtc":"2026-03-21T04:18:16.5156226","modifiedOnUtc":"2022-11-29T03:19:19.41849"}