Web Widget/Help Center : Can the web widget just be a link that redirects to the help center once clicked?
We would like to see if the web widget can just link directly to the help center when the icon is clicked on our website. Is that possible?
-
Hi Salim,
The web widget isn't really intended to function that way. Creating a custom element in your page modeled on the web widget appearance might be more in line with the functionality you're looking for. If there's a specific use case you're trying to solve for, let me know and we can look further in to it.
Tipene
-
The user case in this scenario is that rather than giving the ability to the customer to search articles through the widget and have the contact form available. If they click the web widget icon it redirects to the help center . Mostly for article formatting, videos, etc.
It also adds an extra step for the customer to try harder to find their answer rather than just defaulting to the "contact us" button after a simple search on the web widget.
-
Hi Salim,
Thanks for sharing.
Adding something like this to the website code would achieve what you're looking to do:
<script type="text/javascript"> zE("webWidget:on", "open", function () { return window.location.href = "https://www.{your_help_center}.zendesk.com" }); </script>
-
Thank you!
-
Few other questions Tipene Hughes would this open the help center in a new tab or the existing one? Also would the code replace the standard web widget code snippet or just add to it and does the position where it's added matter?
-
Hi Salim,
This will open the Help Center in the same tab. Also, it would not replace the launch snippet copied from the admin settings. Include this code after that snippet.
-
Would it be possible to have it open in a new tab rather than the same tab?
-
Hey Salim,
You'd just switch it to use "window.open":
<!-- Start of Zendesk Widget script -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=123"> </script>
<!-- End of Zendesk Widget script -->
<script type="text/javascript">
zE("webWidget:on", "open", function () {
return window.open('https://{your_help_center}.zendesk.com', '_blank');
});
</script>
Thanks!
-
Hi Eric Nelson , Tipene Hughes,
So we implemented the code and it does redirect to the help center when the web widget is clicked which is great! However, when you go back to the website where the web widget lives, the contact form is automatically opened. Is there a way to keep the widget in its original state and not have the form open when clicked?
-
-
Thanks Eric Nelson, and would this be applied to the original Zendesk widget snippet or the modifications we made to have it open the help center if clicked?
Would I simply change
zE("webWidget:on", "open", function () {
TO
zE("webWidget:on", "close", function () {
-
Hey Salim,
If you want users to always get redirected to the help center you'd use this:
<script type="text/javascript">
zE("webWidget:on", "open", function () {
zE('webWidget', 'close');
window.open('https://example.zendesk.com', '_blank');
})
</script>
If you want users to be able to use the web widget / contact form after their first redirect you'd use something like this:
<script type="text/javascript">
let clicks = 0
zE("webWidget:on", "open", function () {
if (clicks === 0) {
zE('webWidget', 'close');
clicks++
window.open('https://example.zendesk.com', '_blank');
}
})
</script>
This keeps track of the amount of clicks on the web widget button. Then if it's been clicked once or more, it'll open the web widget as normal instead of redirecting.
Hope this helps,
-
Awesome, thank you Eric Nelson , that should work to stop the contact form from opening after the button is clicked.
Thanks as well for the second suggestion!
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
13 Kommentare