Skip to main content

Solved

12360 Topics
Started Checkout Javascript Metric not working

Hi there,since our WooCommerce checkout is custom built, I am trying to implement the “Started Checkout” metric with an onClick of a button.The onClick is definitely fired (according to the console.log) and the data is not empty (according to the alert), but somehow the customers profile is not appearing in the Klaviyo dashboard.What is wrong with my code?  <script>jQuery("#ceesbutton").click(function($){    var email = jQuery('input[name="billing_email"]').val();        var first_name = jQuery('input[name="billing_first_name"]').val();    var last_name = jQuery('input[name="billing_last_name"]').val();            <?php            $cart = WC()->cart;            $event_data = wck_build_cart_data( $cart );            if ( empty($event_data['$extra']['Items']) ) { return; }            $event_data['$service'] = 'woocommerce';            unset($event_data['Tags']);            unset($event_data['Quantity']);                        $taal = strtoupper(ICL_LANGUAGE_CODE);        ?&g