Using Code Injection

You can add custom code and scripts to your site using the Code Injection area in Website Settings.

When to use Code Injection

Use Code Injection to add HTML and scripts that enhance specific parts of your site. These might include flash or JavaScript, a Google sitemapGoogle Translate, live chat services, domain verification for custom email services, or site analytics.

Code Injection isn't intended for adding content or styles. To add content to your site, visit Adding and editing content. To add custom CSS for styles, use the Custom CSS Editor.

Before you begin

  • Creating and adding code to Code Injection is an advanced modification that requires programming knowledge. Squarespace doesn't provide code-based support.
  • Code added to Code Injection fields will apply to all your site pages, regardless of any styles or style overrides you're using. Unlike Squarespace 7, Squarespace 5 doesn't support per-page code injection.
  • You can add code within the <head> tag using the Extra Header Code field for every Squarespace 5 site. You must be on the Unlimited plan to access all ten code injection points (as shown in the screenshot below).

 

Step 1 - Open Code Injection

  1. Log into your site and open the Website Management bar.
  2. Cick Website Settings under Structure.
  3. Go to the Code Injection tab.

Step 2 - Add HTML code

Select an Injection Region from the drop-down.

Note: If you're not on the Unlimited plan, you can only access the Extra Header Code injection region.

Paste your code into the HTML Code field.

 

Step 3 - Save

Click Update Information.

Once you add code to an injection region's code field, the drop-down for that region will include an Edited flag. 

Note: Adding or modifying code on your site is an advanced modification. We highly recommend that you have coding knowledge to use Code Injection. While we can't offer more help on this topic, here are some resources to point you in the right direction:

Was this article helpful?
0 out of 0 found this helpful