When installing Chameleon, there are two components that need to be implemented: 

  1. The Chameleon code snippet (to load the builder and Experiences).
  2. The Identify method (to identify users).

We ask developers to identify users by their database ID. This stable identifier ensures that a user sees tours consistently (for example, resuming on the correct step if they leave and return).

Identifying users who are not logged-in

For users that don't have a logged-in identity (e.g. visitors), we recommend generating a unique ID and storing it to a cookie, from which it will be read afterward.

This can be achieved, for example, by using the following code between the Chameleon code snippet and the Chameleon identify method. 

/* chmln code snippet */

if(user is not logged-in) { var uid;
  try { uid = document.cookie.match(/\bvisitor-uid=([a-z0-9-]+)(;|$)/)[1]; } catch(e) {
    document.cookie = 'visitor-uid='+(uid = Math.random().toString(36).substring(2))+'; expires=Tue, Oct 13 2037 04:24:07 UTC; path=/;';
  }

  chmln.identify(uid, { visitor: true });
}

/* normal chmln.identify with user.id */


The impact on Monthly Active Users

Identifying anonymous users to Chameleon will also represent an impact on your MAU count, since each anonymous session is counted as an additional user.

Moreover, the generated anonymous ID is stored in a cookie, which is likely session-based, and users can clear their browser data -- thus giving an inconsistent perception of the actual users that are engaging with Chameleon Experiences.


Explore more

Did this answer your question?