Skip to main content

Code Snippets

Insert custom codes and third-party scripts to enhance your Storefront

Code Snippets allow you to add custom code and third-party scripts to your storefront for advanced customization.

πŸ“ NOTE: Code Snippets are available on the Uscreen Plus plan. If you're not currently on Plus, get in touch with sales@uscreen.tv to discuss an upgrade.

Access the Code Snippets

Navigate to Settings > Snippets

Alternative Method

  1. Navigate to Website

  2. Go to the Advanced tab

  3. Scroll down to Customizations

  4. Select Head Code


Specifications of the Code Snippets

The Code Snippets consist of three sections.

Common Pages (CSS)

  • Supports: CSS only; write your styles directly, no <style> tag needed

  • Applies to: Common pages (Login, Signup, Password Reset, and other non-catalog pages)

  • Ideal for: Applying custom styles specifically to common pages without affecting the rest of your storefront

πŸ“ NOTE: Styles added here will not apply to your Catalog, Program Pages, or other storefront pages. Use Head Code instead if you need styles that apply across your whole site.

πŸ”— Learn more about Common Pages

Head Code

  • Supports: HTML, CSS (inside a <style> tag), JavaScript (inside a <script> tag)

  • Applies to: Your entire storefront; code here is injected into the global <head> tag of every page

  • Ideal for: Adding third-party scripts (analytics, marketing pixels, chat widgets), global CSS overrides, or any code that needs to run across your whole site

πŸ“ NOTE: Code Snippets do not apply to your native mobile or TV apps. For app customization options.

Purchase Code

  • Supports: HTML, CSS (inside a <style> tag), JavaScript (inside a <script> tag)

  • Applies to: The Order Confirmation page that appears after a purchase is completed

  • Ideal for: Purchase tracking pixels, conversion scripts, or any code that should only fire after a successful transaction

⚠️ WARNING: Purchase Code applies to the Order Confirmation page only, and it does not apply to the checkout page itself. If you need to add code to the general checkout flow, use Head Code instead.

πŸ”— Learn more about the Checkout Purchase Flow


Important Considerations

Before adding or editing any code, here are a few things worth knowing:

Custom code applies to the web storefront only

Head Code is global, so it applies to your entire site

  • Any code added to the Head Code editor runs on every page of your storefront.

  • Be careful with broad CSS selectors (like header or body) as they can unintentionally affect pages you didn't intend to modify.

  • If you only need code on a specific page, consider using a custom HTML block on that page instead, or using scoped selectors.

Platform updates may affect your custom code

  • Uscreen platform updates can occasionally change how CSS selectors or JavaScript functions behave on the storefront.

  • Your code itself won't be removed, but it may stop working as expected after an update.

  • We recommend reviewing your customizations periodically.

When upgrading to the new Website Editor

  • If you upgrade to the new Website Editor, your existing Code Snippets data remains in your account, but may not automatically apply as before.

  • CSS selectors may need to be reviewed and reapplied since the new editor no longer uses Liquid templates.

  • Always back up your code before upgrading.

⚠️ WARNING: Custom code implementation is outside the scope of Uscreen Support. If you need help writing or debugging custom code, we recommend working with a Uscreen-certified developer.


Backup Your Snippets

We strongly recommend keeping a regular backup of your Code Snippets. Simply copy the content of each editor into a text file and save it somewhere safe.

There is no automatic version history, so if something goes wrong, you'll need to restore from your own backup.

⚠️ WARNING: If you're unfamiliar with CSS or JavaScript, we recommend consulting a developer before making changes.


FAQs

Why can't I see the Code Snippets page in my Settings?

Code Snippets are available on the Uscreen Plus plan only. If you're on a different plan and don't see this option, reach out to sales@uscreen.tv to discuss upgrading.

Can I apply Head Code to just one specific page?

The Head Code editor is a global setting, so it applies to your entire storefront. For page-specific code, we recommend using a custom HTML block on that individual page instead, which gives you more targeted control without affecting the rest of your site.

My custom code stopped working after a platform update. Was it removed?

Your code is still there, as platform updates don't delete Code Snippets. However, updates can sometimes change how certain CSS selectors or JavaScript functions behave on the storefront, which may cause your customizations to stop working as expected. Review your code and update any selectors that may have been affected.

Will my Code Snippets carry over when I upgrade to the new Website Editor?

Your code remains saved in your account, but it may not apply automatically after upgrading. CSS selectors in particular may need to be reviewed and reapplied since the new editor uses a different structure. We strongly recommend backing up your Code Snippets before upgrading.

Can I expose user data (like email or user ID) through Code Snippets?

There is currently no official JavaScript global or built-in method to reliably expose a logged-in user's email, user ID, or subscription status through Code Snippets. If you need this for a third-party integration, we recommend working with a developer to explore options.

My custom background color isn't showing on some pages. What's happening?

Uscreen's built-in Color Scheme (Light/Dark mode) takes precedence over custom CSS background color rules on Home and Catalog pages. If your background override isn't applying, the built-in color controls in the Theme Editor are likely overriding it. Try adjusting the background color there instead.

Did this answer your question?