On select plans, you can add your own custom HTML to expand the capabilities of the SiteSwan editor. This feature is commonly used to add third-party applications, like food ordering services and mailing list applications and others, and requires you to insert or "embed" some HTML code (or an “HTML snippet” or “code snippet” or “invocation code” among other common terms) into your site. There are several ways to insert HTML code onto your sites, and we outline them below.
Please note: this feature is for advanced users only and is only available on select plans. You should only add code from a trusted source. Only add code if you know exactly what it does and how to troubleshoot it if it doesn't work. SiteSwan's Support Team cannot troubleshoot custom code.
OPTION 1 - Add an HTML Section to a Single Page on Your Site
This is most often used when you need to insert a string of HTML code that is written to display something on a page of your site (like a “widget” or when “embedding” something). You will see this post type in the "Add a Section" modal when adding content to your sites. Choose the HTML options and simply copy-paste the code into the box and click “Post”.
Note: You will not be able to view the results of the HTML while logged into the site, and viewing it while in "edit mode". You will either need to view the site in “Preview Mode” or open the site in a different browser that you’re not logged into the site with.
OPTION 2 - Adding Site-Wide HTML (Appears on Every Page of a Site)
This is most often used when you need to insert HTML code onto every page of the site (like an ID tag or pixel code, many times used for digital advertising campaigns).
2A) You can access this option by clicking on Settings > HTML Code in the site editor.
2B) You will see 3 options to add code:
- Header HTML Code - Code gets inserted into the <head> tag/section
- Top Body HTML - Code gets inserted right after the opening <body> tag of the site
- Bottom Body HTML - Code gets inserted right before the closing </body> tag of the site
*The type of code you are looking to add will determine the appropriate placement. Refer to the instructions provided by the code source.
**Be sure to click "Save" when finished.