How to Use Dynamic Polls
The Dynamic polls feature of Klix is designed to allow a single widget embed code, to power multiple polls by asking different questions and segmenting data depending on variables supplied by the website.
#What Does This Allow Me To Do?
A good example usage of this feature is a sitewide content rating system in WordPress. A single widget embed code added to the sidebar of your website could be used to ask the question Rate This Article!. The dynamic poll would load and store results for each article on the website and segment them using the article title.
So in 10 minutes you have a highly engaging, site-wide content rating system with a custom call to action that you control!
Warning
Dynamic polls are a paid feature and will not work on free accounts
#How Do I Setup A Dynamic Poll?
Setting up a dynamic poll involves, firstly adding a question to your poll in the Klix dashboard and marking it as Dynamic.
You then need to add attributes to the <div>
tag of the embed code you place on your website.
There are 2 attributes that control how dynamic polls work.
-
data-segment
- This is the human readable segment under which the results are stored and retrieved, what you will use to find them
- For example, if you were rating products, it may be the product name, for pages, the article title or slug. Something you can easily associate with the results.
-
data-question
(Optional)- This is an optional override to the question setup in the Klix dashboard, allowing you to customise the question to match the segment.
- For example, if you were rating 'products', the default question in your dashboard may be 'Rate this product!', and you can override this with something like 'How do you rate product_name?'
These attributes need to be inserted into the <div>
tag for the embed, here is an example:
<div class="klixEmbed" data-id="embed_id" data-segment="[[product_name]]" data-question="How would you rate [[product_name]]?">
You would simply replace [[product_name]]
with code to insert the current product name from your database. This may come from native php, Shopify, WordPress ACF, whatever code your site is written using.
#Can Dynamic Polls Have Multiple Questions?
Yes, every poll widget that you configure may have multiple questions setup, however it may only have 1 dynamic question.
For example:
- My Sidebar Poll
- Question 1: What do you think of this article? (Dynamic)
- Question 2: What do you think of our site?
- Question 3: Do you trust our brand?
This widget would display all 3 questions, however only a single dynamic question is allowed.
#How Else Might I Use Dynamic Polls?
Here are some examples of how you could use the dynamic polls feature.
- Rate all the articles on your WordPress site.
- Rate all products on an e-commerce store.
- Rate different categories of content on your blog.
- Rate entities from a database in a programmatic website, i.e.
- Games from a game database
- Plans from a product plan setup
- Books from a database of books
The list is literally endless.