Skip to content

Instantly share code, notes, and snippets.

@tmountain
Forked from dngrmice/Tracking_Example
Last active August 29, 2015 14:03
Show Gist options
  • Save tmountain/8f11c3662b7012fc947b to your computer and use it in GitHub Desktop.
Save tmountain/8f11c3662b7012fc947b to your computer and use it in GitHub Desktop.
<script type='text/javascript'>
var _ss = _ss || [];
_ss.push(['_setDomain', 'http://app.sharpspring.com/net/']);
_ss.push(['_setAccount', 'KOI-XXXXX']);
_ss.push(['_setResponseCallback', callThisOnReturn]);
_ss.push(['_trackPageView']);
(function() {
var ss = document.createElement('script');
ss.type = 'text/javascript'; ss.async = true;
ss.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'koi-xxxxx.sharpspring.com' + '/client/ss.js';
var scr = document.getElementsByTagName('script')[0];
scr.parentNode.insertBefore(ss, scr);
})();
</script>
<script type='text/javascript'>
// Example of how to send a transaction, must be run AFTER the first 2 push calls (_setDomain, _setAccount)
_ss.push(['_setTransaction', {
'transactionID': '1234',
'storeName': 'Acme Test Co.',
'total': '28.38',
'tax': '1.29',
'shipping': '15.00',
'city': 'San Jose',
'state': 'California',
'zipcode': '32608',
'country': 'USA',
// the following params can be used for creating/updating
// a contact in the context of the supplied transaction data.
// if this data is omitted, the underlying contact/tracking data
// associated with the visitors browser session is used automatically.
'firstName' : 'John', // optional parameter
'lastName' : 'Smith', // optional parameter
'emailAddress' : 'john.smith@gmail.com' // optional parameter
}]);
_ss.push(['_addTransactionItem', {
'transactionID': '1234',
'itemCode': 'DD44',
'productName': 'T-Shirt',
'category': 'Olive Medium',
'price': '11.99',
'quantity': '1'
}]);
_ss.push(['_completeTransaction', {
'transactionID': '1234'
}]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment