chexton
12/19/2012 - 10:59 PM

OscarWylee Integration

OscarWylee Integration

// All examples in this file go inside <script></script> tags. I've left them out for brevity.

// Firstly, ensure our library loads in the header. Get the code to load (just like Google Analytics) from getvero.com/getting-started

// Secondly, put this code wherever you capture a customer's email: when they sign up, sign in, subscribe to newsletter and complete step one of the checkout.

_veroq.push(['user' {id: 'replace-with-their-email', email: 'replace-with-their-email'}]);

// Thirdly, these are the events we were tracking previously.

// 1. When they visit a product page, e.g. http://www.oscarwylee.com.au/men/optical/frye

_veroq.push(['track', 'view product', {product_name: ‘PRODUCT_NAME’, product_url: ‘PRODUCT_URL’, product_image_url: ‘PRODUCT_IMAGE_URL’, product_gender: ‘PRODUCT_GENDER (male vs. female)’, product_category: ‘PRODUCT_TYPE (optical vs. sunglasses)’}]);

// 2. When they try on a product (i.e. click the 'Virtual try on' button)

_veroq.push(['track', 'clicked virtual try on', {product_name: ‘PRODUCT_NAME’, product_url: ‘PRODUCT_URL’, product_image_url: ‘PRODUCT_IMAGE_URL’, product_gender: ‘PRODUCT_GENDER (male vs. female)’, product_category: ‘PRODUCT_TYPE (optical vs. sunglasses)’}]);

// 3. When they add a product to their cart (i.e. click 'Add to cart')

_veroq.push(['track', 'adds product to cart', {product_name: ‘PRODUCT_NAME’, product_url: ‘PRODUCT_URL’, product_image_url: ‘PRODUCT_IMAGE_URL’, product_gender: ‘PRODUCT_GENDER (male vs. female)’, product_category: ‘PRODUCT_TYPE (optical vs. sunglasses)’}]);

// 4. When they login (i.e. after being redirected to the next page, usually My Account)

_veroq.push(['track', 'logged in']);

// 5. When they sign up (i.e. on the post-signup page)

_veroq.push(['track', 'signed up']);

// 6. When they save their prescription (i.e. after they hit update and the page reloads on http://www.oscarwylee.com.au/prescription/)

_veroq.push(['track', 'saved prescription']);

// 7. When they move through the checkout (i.e. click each of the 'Next step' buttons)

_veroq.push(['track', 'reaches checkout step 1']);
_veroq.push(['track', 'reaches checkout step 2']);
_veroq.push(['track', 'reaches checkout step 3']);
_veroq.push(['track', 'reaches checkout step 4']);
_veroq.push(['track', 'reaches checkout step 5']);

// 8. When they complete checkout

_veroq.push(['track', 'completes checkout']);

// 9. When they view their cart

_veroq.push(['track', 'view cart']);