Virtual try-on on your website
Bring Previaly's virtual try-on to the product pages of your online store. You paste a snippet of code once; from then on, every frame that exists on both sides gets a Try on now button (or an icon over the photo) that opens the try-on on top of your website, with the camera, just like on your Previaly storefront.
Before you start: the model number
Your website recognizes the frame by its model number. For each frame in the Previaly dashboard, use the same SKU (code) the product has in your online store as the model number. Uppercase and spaces don't matter: rb-3025 and RB-3025 are the same code.
If the code isn't the same on both sides, the button simply doesn't show up on that product — and nothing else changes on your website.
The snippet
Copy it in the Previaly dashboard (in Portuguese) under Configurações → Provador no seu site. It looks like this, with your store's address in place of my-store:
<script src="https://previaly.com/provador.js?loja=my-store" async></script>
That's also where you choose between the button above Buy and the icon over the product photo. The choice applies to every product and you can change it anytime, without touching your website.
The button follows your website's language: on a page with <html lang="en"> it says Try on now; with lang="es", Probar ahora.
Where to paste it on each platform
Shopify
On Shopify there is no code to paste: the button comes with the Previaly app, without touching your theme.
- Install the Previaly Virtual Try-On app from the Shopify App Store and, on its screen, tap Connect to Previaly. If you already subscribe to Previaly, just sign in: you keep the same plan and don't pay twice.
- Still on the app screen, tap Open the theme editor, turn on Previaly virtual try-on and save.
Nuvemshop / Tiendanube
Nuvemshop no longer has a free code field: the way in is Google Tag Manager, available on its paid plans. Don't paste the snippet into Google meta tag: that field only takes Google's verification tag.
- At tagmanager.google.com, create an account and a Web container for your store and copy its ID (
GTM-XXXXXXX). - In your Nuvemshop admin, go to Settings → External codes, paste the ID in Google GTM ID and save.
- In Tag Manager, create a Custom HTML tag and paste this snippet, with your store's address instead of
my-store:
<script src="https://previaly.com/provador.js?loja=my-store" async></script>
- Under Triggering, choose All Pages. Save, click Submit and then Publish.
- Open the page of a product that is live on Previaly: the button shows up within a few seconds.
WooCommerce (WordPress)
- Install a code snippets plugin, such as WPCode, and create a footer snippet for product pages — or paste the snippet into your child theme's
footer.php, before</body>. - Save and open a product page to check.
Any other website
Paste the snippet before </body> on every product page. If your website doesn't show the SKU on the page, you can point to the frame directly: add data-sku="CODE" to the snippet on that page, or data-armacao="ID" with the frame's ID (the 12 characters at the end of its Previaly address).
How to check
Open the page of a product whose code exists on both sides. The Try on now button shows up above Buy, at the same height (or the icon, over the photo). When tapped, the try-on opens on top of the site and asks for the camera. Closing it takes you back to your website, without reloading.
Frequently asked questions
Can this break my website? The snippet only adds a button and a window on top; it doesn't change forms, the cart or checkout. When it doesn't recognize the page or the code, it does nothing.
The try-on didn't open inside Instagram. The in-app browsers of Instagram and Facebook don't allow the camera inside another page. In those cases the try-on opens in a new tab, on your Previaly storefront.
Can I turn off PD and fitting height measurement? Yes, in Configurações → Provador. The choice applies to your Previaly storefront and to your website.
I want a different selector for the Buy button. Add data-botao-comprar=".my-class" to the snippet; for the icon, data-foto=".my-gallery". This is for people who edit the theme — in most cases you won't need it.