Connecto Web Event Tracking and Notifications


Connecto allows you to personalize your website with notifications based on user’s prior actions. Which means you can actually target the right segments with the right market. For e.g:

  • You can show some discount to a returning user who has not bought before ✔
  • You can get feedback on the last purchase from a returning user ✔
  • If a user has tried to take an action multiple times, you can ask him if he needs help ✔

This and a lot more can be done via Connecto. The path to personalization passes through tracking user actions (events) and understanding their behavior. So let’s get started on that. But first, you will need to include our JS snippet to all the pages of your website where you want to track user actions or events.

Integrating Connecto Script

The following is the snippet for tracking events (Please include the minified version below):

<!–Start of Connecto Tracking script–><script type=”text/javascript”>
!function() {
var _connecto=window._connecto=window._connecto||[];
_connecto.methods = [“track”,”page”, “identify”, “setProperty”, “removeProperty”, “addToListProperty”, “removeFromListProperty”, “trackSession”, “propertySession”];
_connecto.factory = function(t) {
return function() {
var e = Array.prototype.slice.call(arguments);
return _connecto
for(var t=0;t<_connecto.methods.length;t++) {
var e=_connecto.methods[t];
_connecto.load=function(t) {
window._connecto.writeKey = t;
window._connecto.clientMode = true;
window._connecto.serverMode = false;
var con = document.createElement(‘script’); con.type =’text/javascript';con.async=!0;
var host = (document.location.protocol === ‘http:’) ? ‘http://cdn’ : ‘https://server';
con.src = host + ‘.connecto.io/javascripts/connecto-client.prod.min.js';
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(con, s);
<!–End of Connecto Tracking script–>

Minified Version

<!--Start of Connecto Tracking script-->!function(){var t=window._connecto=window._connecto||[];t.methods=["track","page","identify","property","setProperty","removeProperty","addToListProperty","removeFromListProperty","trackSession","propertySession"],t.factory=function(o){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(o),t.push(e),t}};for(var o=0;o<t.methods.length;o++){var e=t.methods[o];t[e]=t.factory(e)}t.load=function(t){window._connecto.writeKey=t,window._connecto.clientMode=!0,window._connecto.serverMode=!1;var o=document.createElement("script");o.type="text/javascript",o.async=!0;var e="http:"===document.location.protocol?"http://cdn":"https://server";o.src=e+".connecto.io/javascripts/connecto-client.prod.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(o,n)},t.load("***YOUR_LICENSE_KEY***")}();
<!--End of Connecto Script--> 

Tracking Events

Now that the script is out of the way, let’s move to the fun part. Suppose you are an eCommerce website and want to understand how many of your users add product to their cart but never order anything. So, we will track the “Add to Cart” event.

Track ‘Add to Cart’ action:

_connecto.track(‘Add to Cart’, {
‘category': ‘Mobile’,
‘product’: ‘Moto X Mobile’,
‘value’: 19999,

Here, the first parameter is the event name and the second parameter is JSON object of optional parameters that you may want to send for an event.

Similarly you can track an order event.

Track ‘Order’ action

_connecto.track(‘Order’, { ‘value’: 19999 })

Using these events, you will be able to segment and target users by rules of type:

  • User has added something to cart in the last one week / more than 7 days ago.
  • User has added something to cart twice until now.
  • User has placed more than 2 orders.
  • User has added something of category ‘Mobile’ in cart.
2 found this helpful