Universal Installation
This guide covers installing TrialClouds Virtual Try-On on any website, including WooCommerce, WordPress, Magento, custom platforms, or static HTML sites. The installation involves adding a script tag and button HTML to your website.
Best for: Non-Shopify platforms, custom websites, WooCommerce stores Time required: 15-20 minutes Skill level: Basic HTML knowledge helpful Alternative: For Shopify stores, see Shopify App Installation
Step 1: Get Your Site ID
1.1 Login to Dashboard
Login with your account credentials
Complete onboarding if you haven't already
1.2 Find Your Site ID
If you've completed onboarding:
Navigate to Sites section in left sidebar
Find your site in the list
Your Site ID is displayed under the site name
Click the copy icon to copy it
If you haven't set up a site yet:
Click "Add Site" or follow the onboarding flow
Enter your domain (e.g.,
www.yourstore.com)Complete the setup wizard
Your Site ID will be generated
Site ID Format: A long alphanumeric string like cmkozmnbi00012euxrl81rx69
Tip: Keep your Site ID handy β you'll need it for the embed script.
[Screenshot Placeholder: Dashboard Sites page showing site card with Site ID highlighted and copy button]
Step 2: Add the Embed Script
The embed script loads the TrialClouds widget on your website. It must be added to every page where you want the try-on functionality to work.
2.1 Get the Script Code
From your dashboard:
Click on your site
Find the "Embed Script" section
Click "Copy to Clipboard"
The script looks like this:
Replace YOUR_SITE_ID with your actual Site ID if copying manually.
2.2 Where to Place the Script
Recommended Placement: Just before the closing </body> tag
Why? This ensures the page content loads first, then the widget script loads asynchronously without blocking page render.
Alternative: In the <head> section with defer attribute (advanced)
2.3 Platform-Specific Instructions
WordPress / WooCommerce
Method 1: Theme Footer File (Recommended)
Go to Appearance β Theme Editor
Find and open footer.php (right sidebar, under Theme Files)
Scroll to find the closing
</body>tagPaste the script just before
</body>Click "Update File" to save
The script now loads on all pages
β οΈ Warning: Changes may be lost on theme updates. Consider using a child theme.
Method 2: Plugin (Safer for Theme Updates)
Install a plugin like "Insert Headers and Footers" or "Code Snippets"
Go to plugin settings
Paste the script in the "Footer" section
Save changes
The plugin injects the script automatically
Method 3: Custom Hook (Advanced)
Custom HTML Website
Open your main layout/template file (e.g.,
index.html,layout.html,_layout.html)Find the closing
</body>tagPaste the script just before
</body>Save the file
Upload to your server if needed
Example:
Webflow
Go to Project Settings (top left gear icon)
Navigate to Custom Code tab
Scroll to Footer Code section
Paste the TrialClouds script
Click "Save Changes"
Publish your site for changes to take effect
Squarespace
Go to Settings β Advanced β Code Injection
Find the Footer section
Paste the TrialClouds script
Click "Save"
The script will load on all pages
Wix
Go to Settings β Custom Code (under Advanced)
Click "+ Add Custom Code"
Paste the TrialClouds script
Set placement to "Body - end"
Apply to "All Pages" or select specific pages
Publish your site
Magento 2
In Magento Admin, go to Content β Configuration
Select your store view and click "Edit"
Expand "HTML Head" section
Paste the script in "Scripts and Style Sheets"
Save configuration
Clear cache
Alternatively, edit your theme's footer.phtml template file.
React / Vue / Angular (SPA)
For single-page applications, add the script to your main index.html file:
React (public/index.html):
Dynamic Button Detection: The widget automatically detects buttons added dynamically using MutationObserver, so it works seamlessly with SPAs.
2.4 Verify Script Installation
Open your website in a browser
Press F12 to open Developer Tools
Go to Console tab
Type:
window.TrialClouds_APIPress Enter
Expected Result: Should display an object (not undefined)
If you see an object, the script is loaded successfully! β
If you see undefined, the script isn't loading. Check:
Site ID is correct
No JavaScript errors in Console
Script URL is accessible (check Network tab)
[Screenshot Placeholder: Browser console showing window.TrialClouds_API object]
Step 3: Add Try-On Buttons
Now that the widget script is loaded, you need to add "Try On" buttons to your product pages.
3.1 Button HTML Template
Here's the complete button code with all attributes:
3.2 Required Attributes
These attributes MUST be present for the widget to work:
class
Must be trialclouds-trial-widget-trigger-button
(don't change)
data-product-id
Unique product identifier
"SKU123" or "789"
data-product-name
Product title/name
"Blue Cotton Shirt"
data-images
JSON array of image URLs
'["url1.jpg","url2.jpg"]'
data-link
Product page URL
"https://store.com/product"
3.3 Optional Attributes
These enhance functionality but aren't required:
data-brand
Brand/vendor name
"Nike"
data-price
Original price (number)
"99.99"
data-sale-price
Discounted price
"79.99"
data-currency
Currency code
"USD", "EUR", "GBP"
data-source
Pre-loaded customer photo URL
"https://..."
data-user-id
Customer ID (for analytics)
"customer_456"
data-user-name
Customer name (pre-fills widget)
"John Doe"
3.4 Important Notes
Image URLs:
Must be publicly accessible (not localhost)
Use HTTPS (not HTTP)
Format as JSON array:
'["url1","url2"]'URLs should point to model photos (person wearing product)
Button Text:
Customize as needed: "Try It On", "Virtual Try-On", "See On You"
Emojis work great: π, π, π, β¨
Class Name:
The class
trialclouds-trial-widget-trigger-buttonis REQUIREDDon't remove or rename it
You can add additional classes for styling
3.5 WooCommerce Implementation
For WooCommerce, you'll want to dynamically populate product data.
Method 1: Template File Edit
Edit your theme's
single-product.phporcontent-single-product.phpFind a good location (after product image or near Add to Cart)
Add this code:
Method 2: Using Hook (Recommended)
Add to your theme's functions.php:
3.6 Custom Styling
The button inherits your site's default styles, but you can customize it:
Add this CSS to your theme's stylesheet or in a <style> tag.
Step 4: Test Your Installation
4.1 Basic Test
Open a product page where you added the button
Look for the "Try On" button
Click the button
The TrialClouds widget should open in an overlay
β Success: If the widget opens, your installation is working.
4.2 Complete Test
In the widget, click "Upload Photo"
Select a test image with a clear face
Wait for AI processing (20-30 seconds)
View the try-on result
Test download button (if enabled)
4.3 Cross-Browser Testing
Test in multiple browsers:
Chrome
Firefox
Safari
Edge
Mobile browsers (iOS Safari, Chrome on Android)
4.4 Mobile Testing
Test on actual devices:
Open product page on mobile
Button should be visible and tappable
Widget should display properly
Upload from gallery or camera should work
Troubleshooting
Widget Doesn't Open
Check:
β Button has class
trialclouds-trial-widget-trigger-buttonβ Embed script is loaded (check
window.TrialClouds_APIin console)β No JavaScript errors in browser console
β Site ID matches dashboard exactly
β Domain in dashboard matches your actual domain
Images Not Showing
Check:
β Image URLs are publicly accessible (not
localhost)β URLs use HTTPS (not HTTP)
β
data-imagesis valid JSON:'["url1","url2"]'β No CORS issues (check Network tab in DevTools)
Button Looks Wrong
Check:
β CSS conflicts with other styles
β Inspect element to see applied styles
β Add
!importantto your custom styles if neededβ Check for CSS specificity issues
Need More Help?
See Common Issues
Email support: [email protected]
Next Steps
Installation complete! Now optimize your setup:
Customize Appearance: Manage Sites
Optimize Button: Button Customization
Improve Placement: Button Placement
Monitor Analytics: Dashboard
Advanced Topics
Multiple Buttons Per Page
You can have multiple try-on buttons on the same page (e.g., for related products):
Each button will open the widget with its respective product data.
Pre-filling Customer Data
If you have logged-in customers, pre-fill their data for a faster experience:
Security: Never expose sensitive data. Only use publicly available customer info.
Dynamic Buttons (JavaScript)
For SPAs or dynamically loaded products:
Need help? Contact us at [email protected]
Last updated