jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 06/30/2023 : 03:39:31
We have some people helping us with SEO and Google Analytics and are in the process of going live with our new website including the new GA4 functionality included in Ecommerce Templates. They have tested our new site for us and came up with some remarks. I have no technical in-depth knowledge of GT4 and how this works so I can only give you their findings. Hope this will ring a bell on your side. view_item_list is fired on product detail pages, but not on product overview pages. view_item is sometimes fired on product detail pages, but not on all. For example not on: https://www.vaarwinkel.nl/_sandbox/proddetail.asp?prod=ANWBWateratlasStaandeMastRoute In the cart begin_checkout; Add_shipping (add_shipping_info) seems not to work. We have a manual payment option (Email option in settings) that allows clients with an account to login and order on account. This means transactions and orders are automatically aproved without a payment processor. It seems the transaction in GA4 is not closed in those situations. Love to hear what you know about this and what we can do about this. Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
Vince
Administrator
42766 Posts |
Posted - 06/30/2023 : 13:18:32
Hi Jaap quote: view_item_list is fired on product detail pages, but not on product overview pages.
view_item is sometimes fired on product detail pages, but not on all.
As it happens, both view_item and view_item_list appear for me on that page. Just do a "view source" in the browser and check yourself. The reason that both appear is that you have the view_item for the detail page and the view_item_list for the cross sell items. This is debatable really if those should fire a view_item_list as it's not really the products primary location but at the same time they are being viewed. It would be interesting to hear points of view on this. quote: In the cart begin_checkout; Add_shipping (add_shipping_info) seems not to work.
Again I checked the source and it seems ok to me. quote: We have a manual payment option (Email option in settings) that allows clients with an account to login and order on account. This means transactions and orders are automatically aproved without a payment processor. It seems the transaction in GA4 is not closed in those situations.
How can I get to test this? Vince Click Here for Shopping Cart SoftwareClick Here to sign up for our newsletterClick Here for the latest updater
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/04/2023 : 02:45:55
Hi Vince, Thanks for the reply. I will share this with our GT4 people. When you want to test an order with manual payment you need to create an account first and you must be logged in to see the option to order on account. When wanted you can e-mail for a testaccount and password. Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 01:34:45
Hi Vince, Together with our analytics guys we did a live debugging session and we think we have found the reason why view_items in GTA is not always fired. The view_items script is added but there seems to be a problem with the international versus national notation of numbers. Like also in the issue we talked about in an earlier topic. For example on https://www.vaarwinkel.nl/_sandbox/proddetail.asp?prod=plandplotter The following code is added: <script> gtag("event","view_item", { currency:'EUR', value:17.75, items:[ {item_id:'plandplotter', item_name:'Portland Koersplotter', index:1, item_brand:'Blundell Harling', item_category:'Kaartinstrumenten', price:17,75} ]} );</script> The notation for value is correct (international), the notation for price is a Dutch notation with a komma. This explains why it sometimes works (prices and numbers are whole numbers) and sometimes not (broken numbers). Might be this problem exists on more places were numbers are used. Hope this helps? Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 01:40:01
And on the same page the recommended products generate view_item_list. This has the same problem: <script> gtag("event","view_item_list", {items:[ {item_id:'pla0011', item_name:'Weems en Plath single hand passer 7 inch', index:4,item_brand:'Weems & Plath', item_category:'Kaartinstrumenten', price:23,95}, {item_id:'divide6', item_name:'Weems en Plath rechte kaartpasser 7 inch', index:5, item_brand:'Weems & Plath', item_category:'Kaartinstrumenten', price:20,95}, {item_id:'lightdivider', item_name:'Kaartpasser met LED verlichting', index:6,item_brand:'Weems & Plath', item_category:'Kaartinstrumenten', price:22 }] }); </script> As you see the 3rd product has a whole price -> no problem. The first and second have a broken price -> problem with komma. jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
Vince
Administrator
42766 Posts |
Posted - 07/06/2023 : 03:30:57
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 05:18:52
Hi Vince, Will download the latest version of the updater and check. Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 07:35:39
Hi Vince, The problem with view_item and the price tag in Dutch notation also exists in the latest updater. I have traced this in the code to incproddetail.asp At the bottom is a bit of code: if googletagid<>"" AND analyticsoutput<>"" then session.LCID=1033 print "<script>gtag(""event"",""view_item"",{ currency:'" & countryCurrency & "',value:" & totprice & ",items:[" & analyticsoutput & "]});</script>"&vbLf session.LCID=saveLCID end if
This should make the number convert to international notation. But you use the string analyticsoutput which is created earlier on outside the LCID. I have changed the line where this string is created a bit higher up to: session.LCID=1033 if prodid<>giftcertificateid AND prodid<>donationid then call addtogoogleanalyticsplist(rs,analyticsoutput,Count+1) session.LCID=saveLCID
And now the GTA script contains the price in international notation. Hope this suggestion can be added to the updaters. This was quite difficult to spot, but I think it is wise to check all code where Javascript and such is created on the use of local versus international number notations. Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 07:55:40
In addition this piece of code is also needed in incproductbody2.asp session.LCID=1033 '// !! call addtogoogleanalyticsplist(rs,analyticsoutput,Count+1) session.LCID=saveLCID '// !!
jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/06/2023 : 13:45:23
I have been checking more locations where a gtag script is being generated. And found another location where a string with price information is created outside a LCID check. incthanks.asp: line -> ao=ao & "price:" & jsescapel(itemtotal) & ",quantity:" & rs("cartQuantity") & "}" function jsecapel convert itemtotal to a string jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
Vince
Administrator
42766 Posts |
Posted - 07/10/2023 : 03:30:27
|
jaapg@promanent.com
Advanced Member
Netherlands
376 Posts |
Posted - 07/10/2023 : 04:57:27
Great thanks. That of course will do the trick as well. Thansactions are now logged, including the ones on account (logged in with accounts payable/ e-mail checkout). One question from our Google Analytics guys remains. The begin_checkout call to GA is not made. When I check all ECT code I do not see code for this event, so I guess you migh have choosen not to fire this GA event. Is there a reason for this? According to our GA guys this event can help with better understanding of the checkout process in GA. Greetings, Jaap jaapg@promanent.comPromanent b.v. www.promanent.com | www.vaarwinkel.nl
|
Vince
Administrator
42766 Posts |
Posted - 07/11/2023 : 11:11:40
|
|
|