Skip to main content
It is typically delivered as an embed on your marketing site, or as part of a Chameleon Tour.
  • 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 a uid 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)

When profile is missing the Demo runs in anonymous mode.
Start with consent mode of “consent not yet given”, with the value pending, 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.
Once the consent screen is dismissed

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 like profile 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.

JavaScript API

The iframe uses window.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

Examples

The example code using analytics.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 with Cache-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.