Marvyn Sue
Marvyn Sue

Reputation: 73

How to Combine external JavaScript with Shopify website

I've tested my website with Pingdom and suggested to combine external javascripts, but I don't know how to do this with shopify website.

Upvotes: 3

Views: 3814

Answers (1)

Debashis Dash
Debashis Dash

Reputation: 342

Adding external script files for Shopify theme is pretty simple.

You just need to upload your script file to the asset folder of your theme file. Or you can create a .js file to paste your code there. After that you just need to include that script file to the theme.liquid file.

Just need to add the following before end of tag in the theme.liquid file.

{{ 'your-script-file-name.js' | asset_url | script_tag }}

Upvotes: 3

Related Questions