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
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)};
salesmachine.Settings("YOUR_API_TOKEN", {});
As soon this script is installed Salesmachine

Add tracking information

Contact information

salesmachine.contact("123456", {
name: "Elon Musk",
gender: "male",
mrr: 99,
account_uid: "78910"
});

Event tracking

salesmachine.track("123456", "user_registration", {
account_uid : "78910",
display_name : "Registration"
});

Where to find the Application Access Token

In the Admin section of the product
Copy link
Outline
Install Script
Add tracking information
Contact information
Event tracking
Where to find the Application Access Token