Skip to content

Instantly share code, notes, and snippets.

@chexton
Created December 16, 2014 07:16
Show Gist options
  • Save chexton/3c12e395843168a1a69a to your computer and use it in GitHub Desktop.
Save chexton/3c12e395843168a1a69a to your computer and use it in GitHub Desktop.
installing-basic-tracking-vero.js
//1. Put this code before </head>. Replace your API (login to Vero account to get it)
<script type='text/javascript'>
var _veroq = _veroq || [];
_veroq.push(['init', {api_key: "YOUR_API_KEY"}]);
(function(){var ve = document.createElement('script');ve.type = 'text/javascript';ve.async = true;ve.src = '//d3qxef4rp70elm.cloudfront.net/m.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ve, s);})();
</script>
//2. Put this code before </head>, after the code above. Replace the email and user's personal details
<script>
_veroq.push(['user', {
id: 'REPLACE', // The ID must be unique, it may simply be the customer's email address
email: 'REPLACE',
first_name: 'REPLACE',
last_name: 'REPLACE'
}]);
</script>
//3. Put this code before </body>. Replace the details of the order
<script>
_veroq.push(['track', 'completes checkout', {
order_total: 50.00,
items_ordered: 3
}]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment