Skip to content

Instantly share code, notes, and snippets.

@chexton
Created December 5, 2012 21:32
Show Gist options
  • Select an option

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

Select an option

Save chexton/4219703 to your computer and use it in GitHub Desktop.
Vero Knotty Integration Code
// Each line of code here is JS so you'd put it in <script></script> tags where required. I am going to leave these out for clarity :).
// 1. Track when someone signs up. Note when identifying a user you can record *any* attributes you want.
_veroq.push(['user', {email: 'customer-email@domain.com', first_name: 'first-name', last_name: 'last-name'}]);
_veroq.push(['track', 'signed_up']);
// 2. Track when someone signs in.
_veroq.push(['track', 'signed_in']);
// 3. Track when someone views a product
_veroq.push(['track', 'viewed_product', {sku: 'product-sku', name: 'product-name', price: 'product-price', url: 'product-url', image_url: 'product-image-url']);
// 4. Track when someone adds a product to their cart
_veroq.push(['track', 'added_product_to_cart', {sku: 'product-sku', name: 'product-name', price: 'product-price', url: 'product-url', image_url: 'product-image-url']);
// 5. Track when someone begins checkout
_veroq.push(['track', 'began_checkout']);
// 6. Track when someone purchases a product. You would cycle through each product after they complete a purchase.
var products = [PRODUCT-ARRAY]
$(products).each(function(){
_veroq.push(['track', 'added_product_to_cart', {sku: 'product-sku', name: 'product-name', price: 'product-price', url: 'product-url', image_url: 'product-image-url']);
});
// That's it! You can track any event you want. You should also check out our docs for direct API requests: https://github.com/getvero/vero-api. For example, tracking the purchases in step 6 is really just passing a JSON object with product details to us in real time. This can easily be done on the backend.
// Questions: support@getvero.com or chat with us, http://www.hipchat.com/g4DoJPkMW.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment