> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.wpcompress.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Using the Universal Version (Wordpress or Non-WordPress)

# Using the Universal Version

| No matter if your website is using WordPress, Weebly, SquareSpace or completly custom built, we have you covered with Real-Time Image Optimization.

### Step 1

It's as simple as linking your website according to the [Quick Start Guide](https://wpcompress.com/quick-start/), and selecting the Universal JavaScript option to generate your unique script.

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/universal-js-screen1_pw8nz4.png)

### Step 2
Copy the generated code snippet and paste it before the </head> tag on your website.

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/universal-version-code_w6ubjh.jpg)


![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/screen-shot-2021-04-08-at-9072_ch8v0x.png)

- [Guide for SquareSpace Head Tags](https://support.squarespace.com/hc/en-us/articles/205815908-Using-Code-Injection)
- [Guide for Shopify Head Tags (Steps 1-3)](https://bind.media/cro/where-to-add-hotjar-code-in-shopify/)
- [Guide for WordPress Head Tags](https://www.quora.com/Where-can-I-find-the-head-tag-in-wordpress-for-Google-Adsense)

|| It's simply copy and pasting, no coding or developer required; however if you ever have questions about this, simply reach out via chat support and we'll be happy to help!
### Step 3

That's it... once pasted you're all set with real-time image optimization and can remote manage the optimization settings from the [Management Portal](https://app.wpcompress.com)!

### Advanced Scenarios

###### Setting up a Custom CDN CNAME

Simply point a CNAME from your hosting or DNS management panel towards your zapwp.com hostname.

| In the example above you'd point cdn.mysite.com to 42b2d6.zapwp.com and replace the url src in your script to <script type="text/javascript" src="https://cdn.mysite.com/generate_js:true"></script> this will allow for your domain to serve images from cdn.mysite.com using the power of WP Compress Real-Time Image Optimization!

###### Images not loading from CDN or duplicate loading of images

In order for us to intercept the images before they load, your images **must have a data-src tag, rather than a src tag**. This is due to browser prioritizations. While most sites use data-src by default for best practice with lazy loading, you'll need to change from src to data-src.

If you have specific questions on this please reach out and we'll be happy to help!


|| If you're looking for local optimization on a Non-WordPress site you may use our standalone version.

