Square Online is a popular e-commerce platform. Here's how to use Osano with Square Online.
In Osano, the "Get Code" button will become active after creating and publishing your configuration. This button will provide you with the osano.js.
Square
In order to run effectively, however, Osano needs to be injected into the global <head> of the document. The goal is to add your own header to your Square Online site. Read more about adding custom code to your Square Online site here.
For compliance reasons, the Osano script should be the first script to execute in the <head> of your website.
-
On your Square Online Overview page, go to Settings > Tracking Tools.
-
Select Add new code.
-
In the pop-up window, enter the code's name (Osano) and paste your Osano script into the corresponding field.
<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.
-
To place the code in the header, select head.
-
Select Save when finished.
-
Publish your site from the Square Online site editor to see the changes live.
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.