Installing Osano on Squarespace

  • Updated

In Osano, after creating and publishing your configuration, the "Get Code" button will become active. This button will provide you with the osano.js.

Squarespace

There are many ways to inject custom code into your Squarespace site. In order to run effectively, however, Osano needs to be injected into the global <head> of the document. The easiest way to accomplish this is via Code Injection.

Note: In Squarespace, code injection is a premium feature available in Business and Commerce plans.

To add custom code to code injection:

  1. In the Home Menu, click Settings, click Advanced, then click Code Injection.
  2. Add the Osano scripts into the Code Injection field for the header. Code added here is injected into the <head> tag on every page on your site.
       <script src="https://cmp.osano.com/user_id/config_id/osano.js"></script>

    User_id / Customer_id

    This is generated by the Osano application when you create your osano.js. It is the first string of numbers in your javascript and will be unique to your organization. All configurations in your account will have the same user/customer_id.

    Configuration_id

    This is generated by the Osano application when you create your osano.js. It is the second string of numbers in your javascript and will be unique to each configuration you create. All configurations in your account will have a unique configuration_id. 

  3. After adding your code, click Save.

Once added and saved, run the application, inspect and check. You should see the script added inside the head tag. 

Important: The Osano.js should be placed without any async or defer attributes. Compliance cannot be guaranteed when using the attributes above.