Change When Scripts Load on Your Shopify Store
Overview
The Change When Scripts Load feature allows you to control how Rose Perl app scripts are loaded on your Shopify storefront. This can help optimize storefront performance, improve compatibility with themes or third-party apps, and fine-tune how features initialize across your customer experience.
When enabled, Rose Perl adjusts the loading behavior of storefront scripts to better align with your theme structure and storefront rendering flow.
Important: When this feature is active, the Rose Perl App Embed must also be enabled inside your Shopify theme settings.
Why This Feature Matters
Shopify themes and third-party applications can sometimes load scripts at different times during page rendering. In certain setups, this may cause:
Delayed feature initialization
Theme compatibility issues
Elements loading before storefront scripts are ready
Tracking or interactive widgets not appearing consistently
Conflicts with optimization or caching apps
The Change When Scripts Load setting provides an alternative loading strategy designed to improve compatibility and stability.
Before You Begin
Before enabling this setting:
Ensure your Shopify theme is published and up to date.
Confirm the Rose Perl app is properly installed.
Make sure the App Embed for Rose Perl is enabled.
If the App Embed is disabled, storefront features may not load correctly after changing the script loading behavior.
Enable the Rose Perl App Embed
Step 1 — Open Shopify Theme Customizer
Inside Shopify Admin:
Go to Online Store → Themes
Select your active theme
Click Customize
Step 2 — Open App Embeds
Inside the theme editor:
Select the App embeds icon from the left sidebar
Locate the Rose Perl app embed
Step 3 — Enable the App Embed
Toggle the embed to ON.
Once enabled:
Click Save in the top-right corner
Your storefront is now ready to use the custom script loading behavior.
How to Change When Scripts Load
Step 1 — Open the Rose Perl App
From your Shopify Admin:
Open Apps
Launch the Rose Perl app
Step 2 — Navigate to Storefront Settings
Inside the app:
Open Settings
Navigate to Storefront or Performance Settings
(Available menu names may vary depending on your app version.)
Step 3 — Enable “Change When Scripts Load”
Locate the setting:
Change When Scripts Load
Enable the toggle.
Once enabled, Rose Perl storefront scripts will use the alternative loading strategy.
Recommended Usage
This setting is recommended when:
Your theme uses heavy JavaScript customization
Another app modifies storefront rendering
Features appear inconsistently on page load
You use performance optimization apps
Dynamic sections or AJAX rendering affect storefront initialization
Shopify theme updates impact storefront scripts
What Happens After Enabling
After activation:
Storefront scripts may initialize later in the page lifecycle
Features may become more stable across dynamic page loads
Compatibility with certain themes and apps may improve
Some storefront elements may load slightly differently depending on your setup
Most stores will not notice visual changes, but script timing and initialization behavior may improve.
Troubleshooting
Features Are Not Appearing
Check the following:
The Rose Perl App Embed is enabled
Your theme changes were saved
The feature toggle is active inside the Rose Perl app
Your browser cache has been cleared
Theme Conflicts Continue
If issues persist:
Disable the setting temporarily
Refresh your storefront
Test using an unpublished duplicate theme
Contact Rose Perl Support with:
Your Shopify theme name
A storefront URL
Screenshots or screen recordings
Any console errors from your browser
Best Practices
For the best experience:
Keep the App Embed enabled at all times while using this feature
Test changes on a duplicate theme before going live
Review storefront behavior across desktop and mobile
Recheck functionality after major Shopify theme updates
Technical Reference for RP Support
Note: These notes for Internal use only and are shared for admin use only.
Database Configuration
The script loading mode is controlled directly from the app database.
Database
Use the application's configured MySQL database from:
www/.env
Database variable:
DB_DATABASE
Table and Column
Table
shops
Column
is_use_script_tag
Type:
BOOLEAN
Default:
0 (false)
Migration:
2025_11_09_230702_add_is_use_script_tag_clolumn_to_shops_table.php
(Line 18)
SQL Examples
Check Current Value for a Store
SELECT id, domain, is_use_script_tag FROM shops WHERE domain = 'example.myshopify.com';
Enable ScriptTag Mode
UPDATE shops SET is_use_script_tag = 1 WHERE domain = 'example.myshopify.com';
Disable ScriptTag Mode
UPDATE shops SET is_use_script_tag = 0 WHERE domain = 'example.myshopify.com';
Update by Store ID
UPDATE shops SET is_use_script_tag = 1 WHERE store_id = 12345;
How the Setting Works
The is_use_script_tag field acts as the primary switch for storefront script behavior.
When is_use_script_tag = 1
The application:
Attempts to create and manage Shopify ScriptTags
Uses the ScriptTag loading flow
Loads storefront scripts through Shopify ScriptTags
When is_use_script_tag = 0
The application:
Uses the metafields-based storefront flow
Stores CDN URLs in dedicated CDN setting fields
Relies on App Embed functionality for storefront loading
Related CDN fields include:
cdn_general_settingcdn_dealer_form_settingcdn_wtb_settingcdn_find_online_setting
Do Other Fields Need Updating?
No additional fields are required for the toggle itself.
The is_use_script_tag value alone controls which storefront loading strategy is used.
However:
gid_app_installationshould exist for metafield updatesCDN setting fields are automatically populated by the app when ScriptTag mode is disabled
Important After Changing the Setting
After updating is_use_script_tag, you should run the app's normal publish or settings refresh action.
This ensures:
ScriptTags are refreshed correctly
Metafields are republished if needed
CDN settings are regenerated
Storefront scripts update properly
Without republishing settings, storefront behavior may not immediately reflect the new mode.
App Embed Requirement
When using the metafields flow (is_use_script_tag = 0), the Rose Perl App Embed must remain enabled inside the Shopify theme customizer.
If the App Embed is disabled:
Storefront scripts may not load
Features may fail to initialize
Dynamic storefront functionality may stop working
Additional Notes
Depending on your theme and installed applications, storefront behavior may vary. The alternative script loading method is designed to improve compatibility across a wide range of Shopify storefront environments.
If you are unsure whether this setting is right for your store, contact Rose Perl Support for assistance.
© Rose Perl Technology
