Posted on 11/11/2022 13:10:44
Hi Nicolai,
I am by no means not a pro either, this code could definitely be outdated. I have spoken to one of our SEO guys, and he says that the datalayer push, is the best way to get the data into GTM. Most of our customers are using GTM and through that using GA4 and UA, which means if we use the field provided in website settings we would be double tracking.
In an ideal world we would love to follow googles own recommendations from this link: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm
Alot of our customers also use either cookiebot or cookieinformation, which means that DW cookiemanager is disabled. That would result in us also not getting the tag fired to GTM, so if the tag could be open in some way that it doesn't get blocked by DW cookie, and we would just be able to control the trigger in GTM by using our own cookie manager that would be great.
Lastly we would probably need to set up an "orderreceiptloop" around the tag so that its not able to fire multiple times if the page is being refreshed.
There are a lot of events that would be great to be able to track in a standard version of swift, such as add to cart, checkout steps and other things that would be great to be able to pick up in either GA4 or GTM.
I don't know if its possible to set up an if statement that fires one kind of event if the GTM field has been filled and another if the GA4 field has been filled. Because by the looks of it the GTM and the GA4 events are slightly different.
If you would like to set up a short meeting i'd love to bring in some stronger SEO resources.