Try a live demo — this guide shows you, step-by-step, how to add an eyewear try on Shopify experience to your product pages, place a PDP try on button, edit your theme safely, and run a thorough QA. You’ll learn two zero-code implementation flows (link button and inline embed), the exact metafield and Liquid patterns to use, QA and analytics checks, and quick troubleshooting. For an overview post see this writeup.
Virtual try‑on reduces uncertainty for purchases that depend on fit and look — especially eyewear. For merchants this typically translates into higher shopper confidence, stronger add‑to‑cart intent, and fewer returns compared to static images alone. The underlying value is well summarized by the TryItOn Shopify app listing and a focused discussion on virtual glasses try‑on. For practical ROI examples and metrics on link‑based VTO, see this analysis: ROI analysis.
When evaluating VTO providers you’ll encounter two main approaches:
If you want the fastest path to live, a link/embed option is recommended — tryitonme.com offers a link‑based zero‑code workflow. See the Shopify listing for details and pricing and plan options.
Keywords: embed try on shopify, virtual try on shopify
Before you start editing themes or metafields, prepare these items:
Choose one of two flows below. Both assume you’ve added tryitonme links to product metafields.
Flow
Liquid (conditional button)
{% raw %}{% if product.metafields.custom.tryitonme_link %}
{% endif %}{% endraw %}Minimal JS click handler (example)
document.addEventListener('click', function(e){
const btn = e.target.closest('#pdp-tryon-button');
if(!btn) return;
const url = btn.dataset.tryonUrl;
// open in overlay or new tab - example opens new tab
window.open(url, '_blank', 'noopener');
});Copy suggestions for the button: “Try On”, “See it on your face”, “Try on with AR”.
Microcopy for camera permission: “This experience uses your camera for a live try‑on only. No images are stored without your permission.”
Flow
theme.liquid (async/defer).Async script tag example (place in theme.liquid)
<script async defer src="https://tryitonme.com/embed.js"></script>Iframe placeholder snippet (lazy‑load recommended)
{% raw %}{% if product.metafields.custom.tryitonme_link %}
{% endif %}{% endraw %}Performance note: inline embeds give a seamless experience but should be lazy‑loaded to avoid slowing initial page render. See the TryItOn app listing for embed guidance.
Placement recommendations
Button copy examples: Short: “Try On”. Descriptive: “Try on with AR”. Benefit: “See it on your face”.
AR affordance microcopy (small text under the button): “Live preview — uses your device camera.” Camera permission microcopy: “We use your camera only for the try‑on preview.”
Accessibility essentials: use aria-label on the button, ensure keyboard focus enters any modal and returns to the button when closed, and provide a text fallback link to product images or a video demo.
Where to edit: Dawn / OS2: sections/main-product.liquid or templates/product.json / sections blocks. Classic: product.template.liquid.
Script insertion: Add the async script once in theme.liquid (head or just before </body>), on a duplicated theme for safety.
Example safe snippet (Dawn/OS2)
{% raw %}{%- comment -%} Insert near the Add to Cart block in sections/main-product.liquid {%- endcomment -%}
{% if product.metafields.custom.tryitonme_link %}
{% endif %}{% endraw %}Best practice: duplicate your live theme and test changes on an unpublished copy before going live. See Shopify themes documentation.
Use this compact QA checklist before you publish:
Track try‑on click events via dataLayer or GA4. Suggested event names (example only): tryon_click, tryon_session_start, tryon_session_end. See a practical measurement plan: analytics guide.
Example GA4/dataLayer snippet (example — update to match your analytics)
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'tryon_click',
product_id: '{{ product.id }}',
product_sku: '{{ product.selected_or_first_available_variant.sku }}'
});Q: Button not showing — Cause: metafield missing or namespace mismatch. Fix: confirm metafield exists for the product and Liquid references the correct namespace/key.
Q: Camera blocked or permissions denied — Cause: browser settings or user declined. Fix: show microcopy explaining how to enable the camera or offer static fallback.
Q: Wrong variant loads — Cause: link per product vs per variant mismatch. Fix: request variant‑level links from tryitonme or store variant identifier in metafield. Guidance on frame fit: frame fit guide.
Q: Slow load — Cause: embed loaded synchronously. Fix: move script to async/defer and lazy‑load iframe on click/visibility.
Prepare the following assets for the article (also useful as downloadable attachments):
After you order a package and provide photos, tryitonme processes assets and delivers per‑SKU links in under 3 business days. Learn more.
No — tryitonme uses shareable links and an optional embed script, so you can implement a PDP try on button with minimal theme edits. See the app listing.
The try‑on is a live preview; you should add camera consent language and update your privacy policy. See the app listing for privacy notes: TryItOn privacy.
Yes — push events to dataLayer or GA4 as shown in the QA examples and instrument tryitonme link UTM parameters for channel attribution. See analytics examples.
Provide a static image fallback or a video demo and show microcopy explaining how to enable camera permissions in their browser or device settings.
Adding eyewear try on Shopify to your PDPs is a high‑value, low‑friction upgrade that increases shopper confidence and modernizes the buying experience. With a link/embed approach you can be live quickly and without a full SDK build. To get started, request a demo and rapid onboarding at tryitonme.com. Also download the QA checklist and quickstart assets to keep your launch smooth.
Example — Conditional button (update namespace/key to match your store)
{% raw %}{%- comment -%} Example — update 'custom' and 'tryitonme_link' to your store's metafield {%- endcomment -%}
{% if product.metafields.custom.tryitonme_link %}
{% endif %}{% endraw %}Example — Async embed script (place in theme.liquid)
<script async defer src="https://tryitonme.com/embed.js"></script>Example — dataLayer GA4 event (example — update keys)
// example — update to match your analytics implementation
function trackTryonClick(productId, sku){
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'tryon_click',
ecommerce: {
items: [{
item_id: productId,
item_sku: sku
}]
}
});
}