Good Morning
Perfect, but this does not affect the tracking of the "next" buttons, the code would be copied below.
A question that arises for me is: are the gtag statements executed when the buttons are clicked or when the buttons are loaded on the page? because I detect follow-up of the button to finish the purchase (step == 4), as it was clicked 4 times on it, but there are no purchases in the hikashop panel
window.Oby.registerAjax (['checkoutFormSubmit', 'checkoutBlockSubmit'], function (params) {
var mainDiv = document.getElementById ('hikashop_checkout');
var step = mainDiv.getAttribute ('data-checkout-step');
if (step == 1) {
gtag ('event', 'next_buy', {'event_category': 'payment_process', 'event_label': 'next_buy'});
}
if (step == 2) {
gtag ('event', 'next_session_start', {'event_category': 'paid_process', 'event_label': 'next_session_start'});
}
if (step == 3) {
gtag ('event', 'next_address', {'event_category': 'payment_process', 'event_label': 'next_address'});
}
if (step == 4) {
gtag ('event', 'final_payment_method', {'event_category': 'paid_process', 'event_label': 'finalize_payment_method'});
}
});
Thank you very much, greetings!