Skip to content

Instantly share code, notes, and snippets.

@chexton
Created June 3, 2013 12:35
Show Gist options
  • Save chexton/5697826 to your computer and use it in GitHub Desktop.
Save chexton/5697826 to your computer and use it in GitHub Desktop.
hc-install.js
//1. Grab first snippet of code from https://www.getvero.com/connect and copy paste into header file just before </head>
//2. Add the following code just after the code in step 1 (also in the header just before </head>)
<script>
email = 'customer@domain.com'; // Replace dynamically
_veroq.push(['user', {id: email, email: email}]);
</script>
//3. Put this on the product page template
<script>
_veroq.push(['track', 'views product', {name: 'replace with product name', image_url: 'link to image', url: 'link to product', price: 10}]);
</script>
//4. Place this on the first page/step of checkout (http://www.humblechic.com/ShoppingCart.asp)
<script>
var vero_order_items = [];
$.each(OrderDetails, function() {
vero_order_items.push({
url: 'http://' + window.location.host + '/ProductDetails.asp?ProductCode=' + this[2],
image_url: 'http://' + window.location.host + '/v/vspfiles/photos/' + this[2] + '-1.jpg',
title: this[3],
product_id: this[2],
price: this[5],
quantity: this[6],
});
});
_veroq.push(['track', 'begins checkout', {products: vero_order_items}]);
</script>
//5. Place this code on the post-checkout thank you page
<script>
var vero_order_items = [];
$.each(OrderDetails, function() {
vero_order_items.push({
url: 'http://' + window.location.host + '/ProductDetails.asp?ProductCode=' + this[2],
image_url: 'http://' + window.location.host + '/v/vspfiles/photos/' + this[2] + '-1.jpg',
title: this[3],
product_id: this[2],
price: this[5],
quantity: this[6],
});
});
_veroq.push(['track', 'completes checkout', {products: vero_order_items}]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment