Javascript tracking

Install Script

Salesmachine allow an easy setup by just pasting a javascript code in your application.
Install this script with the appropriate API Token
1
var salesmachine=salesmachine||[];salesmachine.Settings=function(e,a){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="//app.salesmachine.io/javascripts/salesmachine.min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t);for(var s=function(e){return function(){salesmachine.push([e].concat(Array.prototype.slice.call(arguments,0)))}},c=["init","salesmachine","pageview","account","contact","track"],i=0;i<c.length;i++)salesmachine[c[i]]=s(c[i]);salesmachine.init(e,a)};
2
salesmachine.Settings("YOUR_API_TOKEN", {});
Copied!
As soon this script is installed Salesmachine

Add tracking information

Contact information

1
salesmachine.contact("123456", {
2
3
name: "Elon Musk",
4
gender: "male",
5
mrr: 99,
6
account_uid: "78910"
7
});
Copied!

Event tracking

1
salesmachine.track("123456", "user_registration", {
2
account_uid : "78910",
3
display_name : "Registration"
4
});
Copied!

Where to find the Application Access Token

In the Admin section of the product
Last modified 1yr ago