How to add custom code to your site

You can install additional code from a third-party service in HTML, CSS, and JavaScript on your website page. Use this tool to connect analytics scripts, add widgets, animations, and more.

Adding code to your head or body elements

Available with the Pro plan and above, as well as during the 7-day free trial

Go to your website settings

To add scripts that will work on every page of your website, go to the Websites section, select your site, and click Site Settings.

Go to the Custom code tab and click Add code to site.

Select your code location

Choose where to place the code — <head> or <body> sections.

Insert your code

Enter a name for the code you add, and then add the code.

Make sure you copy all the code you need — including the opening and closing tags. Pay attention to which section you place it on your site.

Click Add.

Test your code

After adding the code, republish your site and check the result of running the code.

Please note that there are no restrictions on the inserted code, but the external code may incorrectly affect your site. Check the result of code execution on the site after you publish it.

In case of incorrect script execution, or if you have other questions about the work of the code, contact the support of the service from which you copied the code.

You can also view the added code and edit it. To do this, go to the site settings, the "Custom code" tab, click on the site to view the code, and use in the drop-down menu opposite to edit it.

Read our article How to Index a Site on Google for an example of adding code.

Adding code to a specific part of your website page

If you need to add a custom element to a specific place on your website page, you can do it using the Custom code widget.

Open the drag-and-drop builder. Find a place where you want to add code, and click the + sign.

Select Custom code from the list of widgets, and add it to the page. Click the added element to open a modal window. Paste the code, and click Add to save the result.

Read more: How to add a custom code element to your website page.

    Rate this article about "How to add custom code to your site"

    User Rating: 5 / 5 (8)

    Previous

    How to customize your site

    Next

    How to manage site pages

    Popular in Our Blog

    Try SendPulse today for free