- Product marketing and marketing teams use Demos as the main content of feature-specific landing pages.
- Product managers and product marketing use Demos in-product to drive awareness, upsell, and education.
- Prospects are more likely to buy software they have seen/experienced
The demo can run in Profile or Anonymous modes as outlined below. If possible, run Product Demos in Profile mode
Embedding
Replace the :id below with the Demo ID from the dashboard OR copy the embed code from the Sharing section.
Examples
Profile mode (logged-in user ID)
Any and all times that you have information about the logged-in user. All of the information about what properties/data to send is in the main documentation about Identifying users but the Tl;DR is that you should send at least auid as the User ID from your database, the email, and name.
Feel free to adjust anything other than class and src.
Anonymous mode (the default)
Whenprofile is missing the Demo runs in anonymous mode.
Consent to track (cookies etc.)
Start with consent mode of “consent not yet given”, with the valuepending, then update when the user gives or denies
consent by setting the consent value on the Demos with either granted : denied.
Typically, Product Demos fall into the Functional category.
Schema of properties
These control different aspects of the Product Demo including identity, use of cookies, prefilled data, etc. The data is passed to the iframe via the hash parameters and objects likeprofile and options should be JSON encoded first before being handed to srcWithData
Sending the profile is highly recommended as a method of connecting the dots from
engagement with Product Demos into the other experiences that Chameleon offers such as Tours),
Microsurveys, and HelpBar.
| Property | Values | Description |
|---|---|---|
consent | granted, denied , pending | Whether or not consent has been given. Defaults to granted. Change this when the user gives or denies consent |
profile | \{"uid":"5a17d4", ...\} | A JSON object of data about the current user (encode as JSON before passing to srcWithData) |
options.session_duration | \{"session_duration":15, ...\} | The duration (in minutes) before the user’s session expires automatically. Set to 0 to disable session persistence entirely. |
JavaScript API
The iframe useswindow.parent.postMessage to communicate information back to the parent page. Chameleon also communicates to the Chameleon
JavaScript installation. Below are the messages you can expect from the iframe at the relevant times in the Demo. Message are described below as being sent but this just
means that any listener to window.addEventListener('message', message => ...) will be called.
The message parameter to the callback function is a MessageEvent where message.data is the object sent
from inside the iframe, akin to webhooks (but on the client side).
Message event kinds
| Event kind | Event name | Description |
|---|---|---|
chmln:demo:started | Chameleon Demo Started | When the user clicks on the first step |
chmln:demo:completed | Chameleon Demo Completed | When the last step of the demo is reached. This can happen directly or via branching |
chmln:demo:restarted | Chameleon Demo Restarted | When the user clicks of any call to action that results in restarting from the beginning |
chmln:demo:step:started | Chameleon Demo Step Started | When a Step is displayed to the user; typically because of clicking on the previous step |
chmln:demo:step:completed | Chameleon Demo Step Completed | When a Step is displayed to the user; typically because of clicking on the previous step |
chmln:demo:step:previous | Chameleon Demo Step Completed | When a Step is displayed to the user; typically because of clicking on the previous step |
chmln:demo:component:clicked | Chameleon Demo Component Clicked | When a Hotspot, Tooltip, etc. is clicked |
chmln:demo:button:clicked | Chameleon Demo Button Clicked | When a Button is clicked. Buttons appear in many different places including Tooltips, Chapters, etc. |
chmln:demo:form:submitted | Chameleon Demo Form Submitted | When a form is submitted such as adding an email address and clicking “Learn more” |
Examples
The example code usinganalytics.track should be adapted for how you track analytics in your product. This can also be completely omitted from your
implementation and Demos will run just fine. Consider this optional.
Generic analytics tracking
Analytics tracking
Custom handling of individual events
Speed, Performance, Caching
Including a Product Demo in your marketing site will give your prospective users an inside view into what it is like to use your product. It may given them the confidence to make a purchase, book a demo, or recommend you to their team. It is very important to us that your Product Demos load and run very quickly, do not count against your lighthouse score, etc. If you know the max height and width that a Product Demo is given, change the iframe embed code to specify the height and width in absolute terms or use CSS to give it a fixed size. This will help with Cumulative Layout Shift (CLS). Another important metric is First Contentful Paint (FCP) for which the above-the-fold content is expected to render very quickly. The Product Demo page, that loads in the iframe, is cached withCache-Control: max-age=31556952, public, no-cache which
means the page is stored in the user’s browser and only re-downloaded if the Demo is changed. This page is typically less than 20KB depending
on the length and complexity of the Demo. This page (and all other assets within the iframe) are cached and served from the global CDN edge nodes of Fastly.
Typically without need to return to the origin server. Response times for iframe are typically less than 100ms, often 40ms, and almost always below 400ms.
The rest of the contents of the iframe load only when needed and only as progress through the Demo occurs.
