// --- shopify tracking code (paste directly below your standard tracking code) window.clicky_custom = { 'pageview_disable': true }; function shopify_clicky(){ if( window.clicky ) { analytics.subscribe("all_standard_events", function (e) { clicky_custom.href = e.context.document.location.href.replace(/^https?:\/\/[^/]+/i, ""); clicky_custom.title = e.context.document.untranslatedTitle; if( e.name == 'page_viewed' ) clicky.pageview(); else if( e.name == 'product_added_to_cart' ) clicky.log('#add_to_cart', 'Add to cart'); else if( e.name == 'product_removed_from_cart' ) clicky.log('#remove_from_cart', 'Remove from cart'); else if( e.name == 'checkout_completed' ) { clicky_custom.visitor = { 'username': e.data?.checkout?.email, 'order_id': e.data?.checkout?.order?.id }; clicky.goal('Sale', e.data?.checkout?.totalPrice?.amount); } }); } else setTimeout( shopify_clicky, 10 ); } shopify_clicky();