Best practices - Code

A list of recommendations and best practices to have a great integration

Early and unique instantiation

The VTO module should be instantiated only once (in a valid scope) and the same instance can be used for several VTO experience.

Furthermore, we highly recommend to instantiate the module early in the life cycle of the page (see How to integrate).

Checking frames availability to enable the CTA button

In order to avoid proposing the VTO experience to users for frames that are not available (i.e not digitized), it is recommended to check the availability for each frame to enable (or disable) the CTA buttons (see the corresponding How-to article).

Setting the frame early

Similarly to the VTO module, we recommend to set the frames as early as possible as it will allow to fetch the data in background.

If the frame is known at the instantation time (e.g. a dedicated Product page), use the instantiation parameter (see the Instantiation Parameters).
Else, at any moment, the frame can be changed with the `setFrame` setter, e.g. in the "on click" of a CTA button (see the Instance Methods).