There are many 3rd party applications that require you to add a snippet of code to every page on your website. To do this, we simply create a new widget, add the code to the widget, and then add the new widget to the right place in your Admin area so it then displays on every page of the site.First, we need to create a new widget.



To create a new widget, please follow the steps found here:https://bootstrap.brilliantdirectories.com/solution/articles/5000558911-how-to-add-create-a-new-widget-for-your-site. This is where you would place the code that the 3rd party application requires to be present on every page of your site. For the sake of this tutorial, we will assume that the widget was named “Code On All Pages” (this is what would be entered into the “Widget Name” field. The widget will look something like this after all of this has been set up:



image

 


Once you have saved this widget, we need to place it in the appropriate area of your site.

Most 3rd party applications will either require you to place the code in the <head> section of all pages of your site, or inside the <body> section at the end of every page.


How to add the code to the <head> section of every page:

  1. Login to the Admin area of your site
  2. Navigate to Settings >> Website Layout in the top main navigation
  3. Scroll down to the area called “Website Head / Meta Data”
  4. Enter the code to place the widget here in this format:[widget=Name of Widget]In this case, the widget is named “Code On All Pages” so the code to place the widget will be like this:[widget=Code On All Pages]

    image

     
  5. Click on the “Save Settings” button


How to add the code to the <body> section of every page:It is usually best to add the widget code to the bottom of the Footer of your site as this will be present on every page of your site.To add the code to the Footer in the <body> section of the site, please follow these steps:

  1. Navigate to Toolbox >> Widget Manager in the top main
  2. Enter “Footer” in the “Search By Keyword” field: 
  3. Click on “Search Now”
  4. If the “Default Website Footer” widget is in the “Custom Widgets” area, click on the “Edit” button for this widget. If it is not, click on the “Customize” button for this widget and then once it is added to the “Custom Widgets” area, click on the “Edit” button for this widget.

  5. image



    1. Scroll down to the bottom of the “Widget Code” area and add the following code to the last line:[widget=Code On All Pages]

  6. image



    These are the necessary steps to add your custom script code to every page of your site.