chexton
3/20/2013 - 10:49 AM

vero-installation.html

vero-installation.html

<!-- 1. Install the library from getvero.com/connect on every page before </head> -->

<!-- 1a. Put the user identification code below in the </head> tag whenever a user is logged in. -->
<script>
  var email = 'logged-in-users-email@domain.com';
  _veroq.push(['user', {id: email, email: email}]);
</script>

<!--  1b. Whenever you get a customer's email via the checkout or subscribe forms (e.g. the popup) you'll want to call the above code as well. For more detail on how to do this before a form submits, refer to our knowledge base: https:<!-- www.getvero.com/knowledge-base#/questions/49211-How-do-I-capture-my-customers-email-and-details-after-they-submit-a-form -->

<!--  2. Track when customers COMPLETE checkout (this is a goal event, very important) -->
<script>
  _veroq.push(['track', 'completed checkout', {total: 'replace-with-total-value'}]);
</script>

<!--  3. Track when a customer views a product. Update the attributes dynamically. --> 
<script>
  var product_details = {name: 'Square Bezel-Set Gemstone Cocktail Ring', price: '150', stone: 'Cushion Blue Topaz', size: 'F'};
  _veroq.push(['track', 'viewed product', product_details]);
  _veroq.push(['user', {latest_product: product_details}]);
</script>

<!--  4. Track when a customer views the cart (http:<!-- www.stylerocks.com/Checkout) -->
<script>
  _veroq.push(['track', 'viewed jewellery box']);
</script>

<!--  5. Track when a customer begins checkout/payment (https:<!-- www.stylerocks.com/Checkout/Payment) -->
<script>
  _veroq.push(['track', 'begins checkout']);
</script>

<!-- 6. BONUS: So we can be fancy, let's track referrers as well. Put this code on the home page just before </body> -->
<script>
  _veroq.push(['user', {referrer: document.referrer}]);
</script>