Skip to content

Instantly share code, notes, and snippets.

@chexton
Last active December 21, 2015 18:29
Show Gist options
  • Select an option

  • Save chexton/6348215 to your computer and use it in GitHub Desktop.

Select an option

Save chexton/6348215 to your computer and use it in GitHub Desktop.
install-vero-ecomm.js
//1. Install this on EVERY page in the header template, just before </head>
<script type="text/javascript">
var _veroq = _veroq || [];
_veroq.push(['init', { api_key: '0826fd9f355e27524590db76d0114186e17d5723'} ]);
(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. Install this below the above script on pages where you have the customer's email address. E.g. when they sign in
// or when they enter their email in checkout. Replace the "EMAIL" field with their email, dynamically.
<script type="text/javascript">
var email = "EMAIL";
_veroq.push(['user', {
id: email,
email: email
}]);
</script>
//3. Track when a customer starts checkout
<script type="text/javascript">
_veroq.push(['track', 'begins checkout']);
</script>
//4. Track when a customer completes checkout
<script type="text/javascript">
_veroq.push(['track', 'completes checkout']);
</script>
//5. Track when a customer visits the home page
<script type="text/javascript">
_veroq.push(['track', 'visits homepage']);
</script>
// Note that you can track other events as well. Just put them on a button or on a page and change the name of the event. Vero does the rest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment