I tried add event for begin_checkout and I have a problem.
obiect_final = "";
obiect_final += "[";
$('.produs_cos').each(function(){
obiect_final += '{"id":'+$(this).find('.id_produs').val()+',"name":"'+$(this).find('.nume_produs').val()+'","list_name":"","brand":"","category":"","variant":"'+$(this).find('.optiune_produs').val()+'","list_position":1,"quantity":"'+$(this).find('.cantitate_produs').val()+'","price":"'+$(this).find('.pret_produs').val()+'"},';
});
obiect_final = obiect_final.slice(0, -1);
obiect_final += "]";
console.log(obiect_final);
gtag('event', 'begin_checkout', {
"items": obiect_final,
"coupon": "",
});
This is the console.log:
[{"id":489,"name":"Ceai alb Mao Feng Vietnam ","list_name":"","brand":"","category":"","variant":"Greutate: 100 g ","list_position":1,"quantity":"1","price":"33,50 LEI"},{"id":493,"name":"Ceai Ayurveda Pure","list_name":"","brand":"","category":"","variant":"Greutate: 100 g ","list_position":1,"quantity":"2","price":"22,00 LEI"}]
The event is tracked without items array. I think its a problem with items array, but I don
t see where.
Can you help me?
Thank you!!
question from:
https://stackoverflow.com/questions/65851461/gtag-events-begin-checkout 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…