Installing the Tag

To install the tag, we highly recommend that you add its base code between the opening and closing <head> tags on every page where you will be tracking website visitor actions. Most developers add it to their website's persistent header, so it can be used on all pages.

Placing the code within your <head> tags reduces the chances of browsers or third-party code blocking the pixel's execution. It also executes the code sooner, increasing the chance that your visitors are tracked before they leave your page.

Base Code

Installing the tag requires you to add the below code in thehead sections of your website on all pages.

The base pixel code contains your client ID at one place and looks like this:

(function() { var a = document.createElement("script");a.type ="text/javascript"; 
a.async = true;a.src="https://c.o-s.io/__CLIENT_ID__/tracker.js";
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(a,s); })();

__CLIENT_ID__ should be replaced with the id provided by the onlinesales.ai integration team.

In case of Social Media Manager(SMM), a unique __CLIENT_ID__ would be assigned to each seller/merchant and the tag would be placed on that seller/merchant's individual website.

Installing Using Google Tag Manager

The above base code is compatible with Google Tag Manager. You can create a new tag under the Google tag manager to install the same.

Mobile Websites

If your mobile website is separate from your desktop website, we recommend that you add the pixel to both.

Last updated