chexton
12/5/2012 - 9:32 PM

Vero Knotty Integration Code

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.