How Does Your Embed Code Work?
#How Does Klix Display a Poll on My Website?
Embedding a poll requires you to add a small piece of HTML code to your website in order for it to work.
Once you have created a poll within your dashboard, the HTML (called the 'Embed Code') will be available for you to copy from the poll Share/Embed page. It will look something similar to this:
<div class="klixEmbed" data-id="gauge_id"></div>
<script src="https://goklix.com/api/gauge/gauge_id/embed.js" async></script>
This code will need inserting into your website HTML in the exact location you want our poll to appear. Step-By-Step
#How does your Embed Code work?
Our embed code creates a uniquely identified HTML <div>
tag in your page and references a unique javascript file that it designed to generate our widget within that <div>
tag.
The ID of the <div>
tag, and the URL of the javascript file are unique to each widget.
#Why can't I just add your code to the <HEAD> tag?
Our embeds work slightly differently to other embeds you made have added to your website. The embed code needs to be inserted into your HTML in every location in which you want our widget to appear.
This is because our polls support appearing multiple times on the same page, and they also support individual customizations via CSS tweaks.
Also, by individualizing the url of each polls javascript we are able to serve them using a worldwide CDN and offer the best levels of performance to your website.
We do not rely solely on calls to our server to serve your widget for display, so uptime levels for your widget should be ~100%. Even if our website is down for maintenance, your poll will still display.