Using the JS API to send data to Chameleon, trigger Experiences, and track events.
Running JS code from any Chameleon Experience to create custom functionality.
The possibilities this opens are unlimited. For example, you could set a Chameleon button to add focus to a specific input field in your app. 👇 This way you help users take action in the right place to discover the value you are trying to demonstrate.
This gives you the flexibility to incorporate Chameleon into key flows of your user journey, by making API calls either from your app or any other software on your stack.
One interesting use case could be, for example, to track an event every time a user opens a premium feature on your app, and then use this event to target these users for upsells. The API call would look like this:
chmln.track("Visited A/B Testing landing page");.
There are many examples of what you could execute, including:
Scrolling/focusing a user to a different place/element on the page.
Submitting some data to your systems (e.g. interest in a feature).
Opening up another in-product service (e.g. Zendesk chat window).
Giving a user a delightful surprise.
To run code from a button, you'll need to leverage button actions. When the action is defined, the piece of code included will be run as soon as a user clicks the button.
alert("hello world!"); . 😉
You can also check out this article dedicated to showcasing common use cases for this feature, including code examples.
Note: If you employ a Content Security Policy (CSP) then you must add an exception to allow this functionality to be used.